diff --git a/strategy.js b/strategy.js index 75a736c..9404335 100644 --- a/strategy.js +++ b/strategy.js @@ -102,9 +102,13 @@ export async function aiSignal(bars) { }, ], }); - console.log(Date.now()) - const msg = completion.choices[0].message.content - logger.debug(msg); - const sig = JSON.parse(msg) - return sig; + try { + console.log(Date.now()) + const msg = completion.choices[0].message.content + logger.debug(msg); + const sig = JSON.parse(msg) + return sig; + } catch(e) { + return {side : 'HOLD'} + } } \ No newline at end of file