I have a question about MTF programming in general. And that is how to go about knowing when a secondary bar is ending, WHILE THE PRIMARY BAR that ends at the same time is still being processed?
For example, if you have a 5 min chart as the only series, and you are using a specific template, you can use the following to find the FIRST and LAST Bars on a session respectively.
if (Bars.FirstBarOfSession) //Primary Open { DrawVerticalLine("Open"+CurrentBars[0],0,Color.Orange); //Draw Open } if (Bars.LastBarOfSession) //Primary Close { DrawVerticalLine("Close"+CurrentBars[0],0,Color.Red); //Draw Open }
This works, but requires me to split my script up and is cumbersome.
The way NT process the seperate series, is that it processes the primary, THEN the secondary, which occur at the same ending time. Is there a way to know that the current primary bar is the end of the secondary series? As the script technically doesn't know it's the end of the secondary, until the secondary end is processed, which happens after processing the primary?
I have attached a simple script that shows a basic example along with an illustration.
Comment