This is my first post and would apreciate some guidance as I’m new to this and little confused so please bear with me.
I’m trying to figure out a way of handling entry orders for my trading method within a strategy.
Long example: If conditions are met for an entry.
Enter when price trades 1 Tick above the high of the previous (5 min) bar then place stop under previous swing low.
I first tried this with EnterLongStop() which works if flat, but then discovered it would not reverse if conditions for a Short entry were met due to the SetStopLoss() internal order handling rules.
Next attempt I used EnterLong() within the OnBarUpdate() method but it enters too late at the close of the next bar rather than in real time. But it does reverse!
I ruled out using an ATM Strategy because my trailing Stop is 'price action' based and follows under the swing lows.
Now I’m looking at the OnMarketData() method which looks like it will definitely work on live data but not in backtesting with the Strategy Analyzer (which I need it to do).
I’m now a bit stuck and I’d greatly appreciate any suggestions on what aproach I should use to achieve this functionality and still be able to backtest.
Cheers,
Stevo


Comment