NexusFi: Find Your Edge


Home Menu

 





Pausing a strategy when max draw down is reached


Discussion in NinjaTrader

Updated
    1. trending_up 2,228 views
    2. thumb_up 1 thanks given
    3. group 0 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Pausing a strategy when max draw down is reached

  #1 (permalink)
 protrader007 
Bee Cave,Tx
 
Experience: Intermediate
Platform: NinjaTrader
Trading: CL
Posts: 54 since Aug 2010
Thanks Given: 31
Thanks Received: 20

I currently use the following code to pause a strategy when the daily loss reaches a preset limit and it works OK.

 
Code
 
if (Performance.RealtimeTrades.TradesPerformance.Currency.CumProfit <= -MaxDaily Loss)
{
pause strategy code
}
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!

 
Code
 
if (Performance.RealtimeTrades.TradesPerformance.Currency,DrawDown >= MaxDailyLoss)
{
pause strategy code
}
Would someone please tell me what I'm doing wrong and how to do it.

Many thanks.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Are there any eval firms that allow you to sink to your …
Traders Hideout
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Futures True Range Report
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,397 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,537


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.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 protrader007 
Bee Cave,Tx
 
Experience: Intermediate
Platform: NinjaTrader
Trading: CL
Posts: 54 since Aug 2010
Thanks Given: 31
Thanks Received: 20


Big Mike View Post
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.

Mike

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!

Started this thread Reply With Quote
Thanked by:




Last Updated on May 29, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts