NexusFi: Find Your Edge


Home Menu

 





Flatten All ?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one phyzfer with 5 posts (1 thanks)
    2. looks_two Big Mike with 4 posts (0 thanks)
    3. looks_3 gregid with 1 posts (2 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 10,328 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 12 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 phyzfer 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-FIre
Trading: GC, ES
Posts: 73 since Mar 2010
Thanks Given: 40
Thanks Received: 33

Hi everyone,

I'm trying to figure out how to flatten all my open positions. I found this tidbit of information on the NT forum. It's an untested "hack" within NS. However the problem with it is that it turns off the strategy.

NinjaTrader.Gui.SuperDom.SuperDom.FlattenEverything();

I've used it to flatten everything, cancel all orders and to disable the strategy. However, I also want to use it for my Reverse-At-Stop functionality. Unfortunately, my strategy being disabled doesnt help.

I'm not married to the idea of using it for my Stop-At-Reverse code, so does anyone have any hints on how I could do this? Mind you I'm using 'Unmanaged = true'.

Thanks!
phyzfer


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
Day 96 Missiles Hit Kuwait and Bahrain: June 15 Peace at …
Prediction Markets & Event Contracts
Warsh Opens Today, Hormuz June 19 -- WTI Below $80, Fran …
Prediction Markets & Event Contracts
Iran Talks Final Stages -- Two VLCCs Exit Hormuz, Record …
Traders Hideout
El Clasico Draws $9.2M in Prediction Market Action -- Bi …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 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,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,577


I would take the approach of having your strategy manage the orders and not relying on some external flatten command.

If you want to flatten, just have the strategy exit. That way the strategy is still running and can re-enter later.

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 X Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 phyzfer 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-FIre
Trading: GC, ES
Posts: 73 since Mar 2010
Thanks Given: 40
Thanks Received: 33

thanks Mike,

I am going to rely on my stop orders getting filled, before reversing my positions.
Just curious, how do you exit a strategy and then re-enter it later?
Never needed to do that before.

thanks!
phyzfer


Started this thread Reply With Quote
  #5 (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,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,577


phyzfer View Post
thanks Mike,

I am going to rely on my stop orders getting filled, before reversing my positions.
Just curious, how do you exit a strategy and then re-enter it later?
Never needed to do that before.

thanks!
phyzfer

I'm thinking you meant exit a position and re-enter. If you are using wizard only maybe you are not familiar with just the most basic commands of "EnterLong()" and "EnterShort()". Examine the source of some strategies and you'll see.

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 X Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 phyzfer 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-FIre
Trading: GC, ES
Posts: 73 since Mar 2010
Thanks Given: 40
Thanks Received: 33

BM,

No worries. I'm using my own stop orders to handle.
Can't use EnterShort/EnterLong with Unmanaged = true.

thanks!


Started this thread Reply With Quote
  #7 (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,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,577


phyzfer View Post
BM,

No worries. I'm using my own stop orders to handle.
Can't use EnterShort/EnterLong with Unmanaged = true.

thanks!

I admit up front to being sleep deprived.. but what is unmanaged = true? I'm not familiar with that variable, at least I don't think I am.



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 X Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 649 since Aug 2009
Thanks Given: 320
Thanks Received: 623


Big Mike View Post
I admit up front to being sleep deprived.. but what is unmanaged = true? I'm not familiar with that variable, at least I don't think I am.



Mike

With "unmanaged = true" you enter unmanaged order entry handling mode and you are not bound by internal NT entry handling rules.

In this mode you manage your orders by using: SubmitOrder(), ChangeOrder(), CancelOrder(), but you can't use any of the Entry/Exit or Set methods


Reply With Quote
Thanked by:
  #9 (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,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,577


gregid View Post
With "unmanaged = true" you enter unmanaged order entry handling mode and you are not bound by internal NT entry handling rules.

In this mode you manage your orders by using: SubmitOrder(), ChangeOrder(), CancelOrder(), but you can't use any of the Entry/Exit or Set methods

Wow, how did I ever miss this... it is in NT 6.5 or only 7?

That is awesome.

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 X Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 phyzfer 
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-FIre
Trading: GC, ES
Posts: 73 since Mar 2010
Thanks Given: 40
Thanks Received: 33


7 only. It's very useful and goes around some of the idiotic NT nuances for order handling.


Started this thread Reply With Quote
Thanked by:




Last Updated on April 30, 2011


© 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