I have my profit target:
SetProfitTarget(EnterLongName, CalculationMode.Currency, 100);
SetTrailStop(EnterLongName, CalculationMode.Percent, .5, false);
From my observations, as I'm backtesting over the last 5 months with NASDAQ 100 and S&P 500 the trailing stop is never in effect, so it's not just this stock or timeframe. I'm definitely using the API wrong.
Please help!
Log:
3/10/2020 6:45:00 AM Strategy 'MyStrategy/-1': Entered internal SubmitOrderManaged() method at 3/10/2020 6:45:00 AM: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=100 LimitPrice=39.05 StopPrice=0 SignalName='LongProfitTarget' FromEntrySignal='' Strategy 'MyStrategy/-1': Stop/target handling set to 'By strategy position' since currency based stop order was placed. 3/10/2020 1:00:00 PM Strategy 'MyStrategy/-1': Cancelled order due to end of session handling: BarsInProgress=0, orderId='NT-00001-931' account='Backtest' name='Trail stop' orderState=Working instrument='OKE' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=19.52 quantity=100 tif=Day oco='NT-00000-931' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-03-10 06:45:00' gtd='2099-12-01' statementDate='2020-05-27' 3/10/2020 1:00:00 PM Strategy 'MyStrategy/-1': Cancelled order due to end of session handling: BarsInProgress=0, orderId='NT-00002-931' account='Backtest' name='Profit target' orderState=Working instrument='OKE' orderAction=Sell orderType='Limit' limitPrice=40.05 stopPrice=0 quantity=100 tif=Day oco='NT-00000-931' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-03-10 06:45:00' gtd='2099-12-01' statementDate='2020-05-27'
Comment