Would it be possible to not use an array but use a simple integer instead ? When I build indicators I check for once per bar by populating an integer ThisBarStartTime = Time[0];
The BIG issue here is that when an EA is running live an array out of range error stops it dead in its tracks and no further actions can be taken. There is no way to create an alert, push, sms or Telegram meassage to the user because it has simply stopped working. Therefore it ends up with orphaned trades unless they can be identified and managed by reapplying the EA to the chart.
Instead of allow an array our of range error to occur, would it be possible to allow the code to continue and do further checks, i.e. look at the timeframe and check some other flag to see whether it has already been actioned yet on this bar. Then allow it to continue and maybe flag an alert to say there was an issue but at least the ea continues to run . . . . ?
Thanks for looking into it. Appreciated.