I understand my question is a little complicated, and I cannot post all my code, but I'll try to explain as well as I can my problem. I have a strategy that draws and relies on RegionHighlightY zones on the chart, that I use to manage entries and exits. Everything works well, except that when the markets are closed, I would like to set up my zone in advance for the next morning, but if I leave my strategy as-is, they are not appearing until the first bar of the market open.
Some details:
- the strategy needs to work in Calculate.OnPriceChange
- at first I was using
if (State == State.Historical) {return;}
- I changed that part for
if ((CurrentBar < Count-1)
- if I could only keep the strategy working on state realtime it would be better, because on the historical bars it is very slow before reaching realtime.
So the strategy works and I understand it might be difficult for you to give hints without seeing the rest of the code, but if there's something that crosses your mind I'd be happy to try it!
Thanks

Comment