PDA

View Full Version : Trade Performance Class and Backtesting


tschalli27
03-01-2010, 03:57 PM
Hello,

I use the following code in my strategy to hit my daily PNL targets and then stop strategy.

Performance.AllTrades.TradesPerformance.Currency.C umProfit < 1000


What code can I use for backtesting purposes? What I'm looking for is for during the backtest process for the code to stop just for that day if the target has been hit and then restart on the new day.

Thanks

NinjaTrader_Josh
03-01-2010, 04:27 PM
tschalli27,

Perhaps this reference sample can show you some techniques: http://www.ninjatrader-support2.com/vb/showthread.php?t=4084

tschalli27
03-01-2010, 06:55 PM
Yes this works.

What do you mean by historical Virtual Trades? Is this Market Replay?

NOTE: Using .AllTrades will include both historical virtual trades as well as real-time trades.

Thanks for your help.

NinjaTrader_Bertrand
03-02-2010, 03:41 AM
There's a splitup between accessing all performance data including historical executions or just the realtime trades you generate after starting the strategy.