I currently use the following code to pause a strategy when the daily loss reaches a preset limit and it works OK.
However, I want to pause the strategy when it reaches a max draw down limit. I tried replacing the above code with the following but the strategy is permanently paused. I've messed around with it and can't figure out why it doesn't work!
Would someone please tell me what I'm doing wrong and how to do it.
Last edited by protrader007; May 28th, 2011 at 08:43 PM.
Reason: don't know why it shows a gap in "Currency"
Try printing the value and see what it starts and ends with every day.
If I recall correctly (haven't used NT in about 18 months...), you need to store and reset this value into a private var daily.
At beginning of day, take yesterdays value from Performance.* from the if session.begin() or whatever it is (can't remember), and then after each new trade you simply take the result of that trade and add it to your private value.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
Thanks Mike I'll check out your suggestions. I already print it to a performance window and it shows the correct data i.e. draw down and not toal loss and it resets to zero when I initialize the strategy. It just occured to me that as DrawDown is a negative number the solution may be as simple as using <= -MaxDailyLoss rather than >= MaxDailyLoss but I need some live data to test it!
The following user says Thank You to protrader007 for this post: