NexusFi: Find Your Edge


Home Menu

 





Global Stop


Discussion in NinjaTrader

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




 
Search this Thread

Global Stop

  #1 (permalink)
nourozi
New Zealand
 
Posts: 92 since Jun 2013
Thanks Given: 52
Thanks Received: 30

Hi there,

Is there a way to auto flatten all positions in Ninjatrader once the account reaches a certain amount of drawdown? Preferrably combining unrealized and realized pnl.

For example, my max drawdown is -$800 and I would like to flatten all positions once the realized + unrealized pnl is -$800 or greater.

Thanks,

Erfan.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Quantum physics & Trading dynamics
The Elite Circle
Is there a way to simulate CONTINUOUS CONTRACT?
NinjaTrader
What broker to use for trading palladium futures
Commodities
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Funded Trader platforms
56 thanks
Spoo-nalysis ES e-mini futures S&P 500
16 thanks
The Trading Pit "Futures VIP" Account Journal
15 thanks
GFIs1 1 DAX trade per day journal
15 thanks
Trading with Intuition
14 thanks
  #2 (permalink)
 
sands's Avatar
 sands 
London + UK
 
Experience: Advanced
Platform: Proprietary Analytics
Broker: Multiple broker + Multiple feed
Trading: Currently European and US equities
Posts: 443 since Dec 2013
Thanks Given: 257
Thanks Received: 234

I don't believe that this is possible, however you can programatically exit positions by contract.

Hope that helps.

Reply With Quote
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629



sands View Post
I don't believe that this is possible, however you can programatically exit positions by contract.

Hope that helps.

All is possible in C#, but the question is not clear enough. The answer will be different if it's in a strategy or discretionary.
You can, for example :
- use NinjaTrader.Cbi.Globals.Accounts[].Executions to compute your P&L and unrealized P&L (with an OnPositionUpdate());
- write your last P&L in a flat file, and let a strategy read this file and do what needs to be done;
- read the Ninja database to compute the P&L for the day (or since X hours, ...).

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on March 5, 2014


© 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