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 6,518 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 12 posts
    2. attach_file 0 attachments




 
Search this Thread

Flatten All ?

  #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?
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
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 …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 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,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,539


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 Twitter 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,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,539


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 Twitter 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,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,539


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 Twitter 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: 650 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,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,539


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 Twitter 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


© 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