Hope you can help please. I'm having some difficulties running a backtest of a strategy and trying to print order information to help me debug (once I get the print correct, I'll switch to using StreamWriter). I've read the documentation but I'm a little lost by some of the options and hoping you could advise please. Some context:
1. My backtests have exit at end of day/session enabled
2. When I create an order I set both a stoploss and profit target:
EnterLong(barsInProgressIndex:1, quantity:varOrderQty, signalName:"BuyLong"); SetStopLoss(CalculationMode.Price, varStopLoss); SetProfitTarget(CalculationMode.Price, varTarget);
if ([some logic here) { ExitLong(convertedBaseOrderQty, @"ExitBuyLong", @"BuyLong"); }
https://ninjatrader.com/support/help...?execution.htm has a note saying that end of day exits (context point 1) may not be captured.
https://ninjatrader.com/support/help...rderupdate.htm looks like it may need to be the path I take when order.OrderState == OrderState.Filled, but I'm not sure how to retrieve the qty & fill price info from it (sorry most guides I can see relate to overriding, not just pulling info).
I've also seen posts relating to account positions, so unsure if I'm even looking in the right direction with these methods.
Please could you kindly advise or point to an example strategy that does this?
Many thanks
ChainsawDR
Comment