Hi @petrz.
Thank you very much for so detailed answer. I really appreciate it.
Few, comments, if I may:
That's what I meant by "adjusting the code for every option"
That is very valuable insight. I am glad that I didn't have to learn it the hard way
Oh, I didn't think of that. Sounds like a great tool in the exploratory search for the edge indeed!
And, again, I am the most grateful for all the great inisghts provided. That helped a ton. Can't thank you enough
Thank you very much for so detailed answer. I really appreciate it.
Few, comments, if I may:
Specifically:
1) The function TotalDataCount() < 390 on a Daily bar will now skip 1.5 years worth of data
2) The function SessionIsFirstBar() will return true on every minute update you evaluate it, because there really is only 1 bar for the session, updated every minute.
3) the function DataIsMissing() now evaluates Daily bars, not small data gaps in the 1 minute data (this actually makes a difference of 1 trade on GME)
4) The function BrokerMarketOnClose() handles closing the position differently on a Daily bar built from minute bars with On Bar Update (it will close the position on next bar update), so you have to write a different exit block.
That's what I meant by "adjusting the code for every option"

Not to mention one important thing - when you invoke the strategy with On Bar Update settings in LIVE mode, it will be updated on each new incoming TICK, no matter what source bars its built from. So On Bar Update setting in LIVE mode does not match the behavior in the BACKTEST mode (unlike On Bar Close setting, which behaves the same in both BACKTEST/LIVE mode).
That is very valuable insight. I am glad that I didn't have to learn it the hard way

There's also a catch with Daily bars and On Bar Close - we can't cheat the backtester and look into the future to check the developing bar Open, so what do we do? We look back 1 day into the past and calculate the trades ourselves. We will use the in-built Output Window to basically calculate and create rows of trades, which you will then copy and paste into a new TXT/CSV file and import it into an Excel.
Oh, I didn't think of that. Sounds like a great tool in the exploratory search for the edge indeed!
And, again, I am the most grateful for all the great inisghts provided. That helped a ton. Can't thank you enough