a way for the cBot to know in case an exception happened inside the indicator
Created at 08 Dec 2021, 10:45
a way for the cBot to know in case an exception happened inside the indicator
08 Dec 2021, 10:45
My cBot uses a custom indicator. Is there a way for the cBot to know in case an exception happened inside the indicator? At the moment it keeps calling the Calculate method although the calling for the indicator is inside a try-catch block.
Thanks
firemyst
22 Dec 2021, 10:10
Where do you call the indicator to get it's latest data?
OnBar? OnTick?
A submethod?
In there, you would put the call to get the latest data in a try-catch block. If there's an exception, you can either:
1) log it to the output and keep the cbot runnign
2) set a "flag" of some sort, stop the bot if the flag is set, or again just have it log to output.
It depends on what you need/want to happen.
@firemyst