View Full Version : Money Management & Back Testing
netjms
05-19-2010, 10:51 PM
I am writing a strategy in which I want to exit daily after a certain profit target for the day. I have reviewed the example using Performance.AllTrades... This works of course but when backtesting CumProfit applies to all historical trades. Is there any way to check this daily (while back testing; I understand usring RealtimeTrades will work in real time), e.g. for each trade day in back test, trading stops after profit target is hit for day and then trading starts the next day and so on.
NinjaTrader_Bertrand
05-20-2010, 05:50 AM
netjms, you would need to self calculate this needed value, a related sample showing how to loop through the trades count to arrive at a daily counter for this is found here - http://www.ninjatrader.com/support/forum/showthread.php?t=19289
wahooj
06-11-2010, 09:03 AM
Bertrand,
Is this possible to granulate over various time periods instead of just the current day. I.e. it checks the performance of the previous day, week, month, etc.
thanks
NinjaTrader_Bertrand
06-11-2010, 09:18 AM
wahooj, yes the same idea and stats could be used to accumulate the needed values over a custom period of time (i.e. weekly, biweekly).
wahooj
06-11-2010, 10:53 AM
sorry i should have also asked where to specify.
If I kept the FirstBarOfSession statement would I then have to specify the duration of the session, If so some code would be great.
thx
NinjaTrader_Bertrand
06-11-2010, 11:03 AM
Unfortunately I would not have a sample for this ready, you would need to rework the logic in this case, the reset for your cumulations would then be for example the start of a new week - http://www.ninjatrader-support.com/HelpGuideV6/DayOfWeek.html