Relative bars using Intrabar Order Generation
Posted: Jan 17 2011
I’ve written a system that oscillates long and short between support and resistance values that are recalculated dynamically.
I am getting the intrabar entries and exits I expected, but being the first time I’ve used Intrabar Order Generation, I am not clear on how to track events happening on specific bars. For example, I can see that performance would be better were I to avoid entering a new position if X number of consecutive bars (including the entry bar) have crossed one of the lines.
Normally, I would use CurrentBar to capture the bar where the position was entered, initialize the counter, and then increment the consecutive bar counter. But IOG has me confused: the statement “sell next bar at market” really means next tick. So, how then do you refer to bar relative positions? For example, can you still use “ low[1] “ to refer to the last bar’s low? I'd really appreciate it if anybody has a clean, easy way to accomplish this.
Thanks in advance for the guidance.
I am getting the intrabar entries and exits I expected, but being the first time I’ve used Intrabar Order Generation, I am not clear on how to track events happening on specific bars. For example, I can see that performance would be better were I to avoid entering a new position if X number of consecutive bars (including the entry bar) have crossed one of the lines.
Normally, I would use CurrentBar to capture the bar where the position was entered, initialize the counter, and then increment the consecutive bar counter. But IOG has me confused: the statement “sell next bar at market” really means next tick. So, how then do you refer to bar relative positions? For example, can you still use “ low[1] “ to refer to the last bar’s low? I'd really appreciate it if anybody has a clean, easy way to accomplish this.
Thanks in advance for the guidance.