Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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.
Many thanks.
Can you help answer these questions from other members on NexusFi?
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.
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!