pauljff
10-09-2007, 11:03 AM
I'm encountering a problem with these two functions. I'm not sure if it's a problem with the strategy code or the strategy analyzer. I'll create a simple strategy that has SetStopLoss/SetProfitTarget in Initialize(). Create orders with EnterLong() or EnterShort(). Backtest it in the Strategy Analyzer.
Everything will work fine for so many trades. Then it will ignore the StopLoss/ProfitTarget and keep a trade open for the rest of the backtest.
I've checked over the order log, everything looks ok. The Stops and Limits are being issued. Then I see "Profit Target, Stop Loss, Buy, Exit on Close." The exit on close price is far above the stop/profit level, like they were not there.
I wrote many simple strategies and all had this problem. I downloaded the sample code from http://www.ninjatrader-support.com/vb/showthread.php?t=3222
and it also failed in the exact same way.
Has anyone encountered this problem?
Everything will work fine for so many trades. Then it will ignore the StopLoss/ProfitTarget and keep a trade open for the rest of the backtest.
I've checked over the order log, everything looks ok. The Stops and Limits are being issued. Then I see "Profit Target, Stop Loss, Buy, Exit on Close." The exit on close price is far above the stop/profit level, like they were not there.
I wrote many simple strategies and all had this problem. I downloaded the sample code from http://www.ninjatrader-support.com/vb/showthread.php?t=3222
and it also failed in the exact same way.
Has anyone encountered this problem?