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.
Relative bars using Intrabar Order Generation
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Relative bars using Intrabar Order Generation
with intrabarordergeneration,...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.
1. the bar reference "[1]" remains the same.
2. the only change is order next bar will be executed as order next tick. (note underline highlight above)
ps. I have corrected the syntax in your quote... for bar reference, square brackets are used, not regular brackets.