sample question
-
hi,
the block "once per bar", pass in two cases, at the begining of the next candle or at the middle of the candle before.
Is the a block like "once per bar" but that only pass at the begining of the next candle, and not at the midle of the canlde before?
Thank you
-
It depends. It passes when it is executed and the candle is new for the block. If the block is on top (so it runs on every tick) it passes at the very first tick of the new candle. If it's under some condition it can pass later. So if you want it to pass in the beginning, just place it on top (with no other blocks above).
Also note that each "Once per bar" works for it's own. In other words, if you have multiple blocks "Once per bar" and one of them passes, this will not stop others to pass. Each one has it's own memory (static variable) where the last known candle time is written.