I'm having a bit of a problem which I can't work out despite numerous searches and testing. I get the feeling I'm simply missing something obvious, so I thought I'd ask the collected wisdom in the forums.
My current strategy is based on a 6 Range Chart. For backtesting granularity I've Added a 1 Tick series within the Strategy. All Orders are placed on the 1 Tick Series with a 12 tick PT and a 4 tick trailing Stop set using SetTrailStop().
e.g.
SetTrailStop("FuriousCaterpillar", CalculationMode.Ticks, FuriousStop, false);
This seems to work fine when Backtesting.
I'm currently wanting to Forward test this strategy to work out a few bugs so I can watch it actually entering and exiting. (Still with a 1 Tick series in the script to enable the Trailing Stop to move every tick if required)
Whenever I Enable the Strategy with Market Replay, the historical trades seem to be fine, but any Trades taken once Market Reply begins running have a very odd error occur.
From the Log:
The Order is submitted correctly.
The Order executes correctly.
The PT and Trailing Stop are submitted correctly.
The Trailing Stop moves 1 Tick (in response to price)
The Trailing Stop is cancelled.
This cancels the PT due to being an OCO
The original entry is left naked in the Market with no PT or Stop.
If I remove the 1 Tick Series from the Code, and submit the orders and PT/Stop to the Primary series (6 Range) then it's all fine... But I'm back to the Stop only updating when the next 6 Range Bar Closes which is not enough granularity for this Strategy.
Can you tell me why this occurs?
What are my options for using the Strategy within Market Replay and ensuring the Trailing Stop updates every tick?
Will I require markedly different code for Back testing vs Market Replay testing?

Comment