Hi, I’m new to Esignal and new to EFS code, and not very computer literate!
I’m trying to code the following breakout strategy to back test 2-3 years worth of futures data:
1. The chart is using hourly bars, starting at 8:00 and finishing at 21:00 (London time)
2. The high-low range of the first 2 bars (hours) of each day is recorded.
3. From 10:00am on, if price moves above the high (+ 2 ticks) then a long position is entered. Target is the entry price plus the range (i.e. high minus low), and the stop is entry price minus half the range.
4. If price moves below the low of the range (- 2 ticks), then a short position is taken with the target again being the range and the stop half the range.
5. If a stop is triggered, then the strategy ‘resets’ to take any further long or short trades that are triggered.
6. If a target is hit, then no more trades are taken until the following day.
7. At 21:00, any open positions are closed at market.
I have spent some time trawling through the various resources available and have found some of the basic code to enter trades, but can’t find any details for code that will generate a range based on the first 2 intraday bars. Any help gratefully received!
Thanks,
Duncan
I’m trying to code the following breakout strategy to back test 2-3 years worth of futures data:
1. The chart is using hourly bars, starting at 8:00 and finishing at 21:00 (London time)
2. The high-low range of the first 2 bars (hours) of each day is recorded.
3. From 10:00am on, if price moves above the high (+ 2 ticks) then a long position is entered. Target is the entry price plus the range (i.e. high minus low), and the stop is entry price minus half the range.
4. If price moves below the low of the range (- 2 ticks), then a short position is taken with the target again being the range and the stop half the range.
5. If a stop is triggered, then the strategy ‘resets’ to take any further long or short trades that are triggered.
6. If a target is hit, then no more trades are taken until the following day.
7. At 21:00, any open positions are closed at market.
I have spent some time trawling through the various resources available and have found some of the basic code to enter trades, but can’t find any details for code that will generate a range based on the first 2 intraday bars. Any help gratefully received!
Thanks,
Duncan
Comment