NexusFi: Find Your Edge


Home Menu

 





Global Stop


Discussion in NinjaTrader

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




 
Search this Thread
  #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?
Would a node-based workflow for automated trading be useful?
Traders Hideout
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Fed Hike Odds at 57% After Warsh: England Surges 12.9%, …
Prediction Markets & Event Contracts
Daytrading to swingtrading
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 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: 440 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 Administrator
 
Posts: 3,767 since Jun 2009
Thanks Given: 3,836
Thanks Received: 4,691



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)
Reply With Quote
Thanked by:




Last Updated on March 5, 2014


© 2026 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 - Downloads - Top
no new posts