NexusFi: Find Your Edge


Home Menu

 





Stop strategy disabling when position closed.


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two redratsal with 1 posts (1 thanks)
    3. looks_3 phantogram with 1 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 8,243 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Stop strategy disabling when position closed.

  #1 (permalink)
phantogram
Dallas, TX
 
Posts: 5 since May 2011
Thanks Given: 0
Thanks Received: 0

Currently, if I close a position or go to Flatten All while I have a strategy running on that same instrument that I closed the position on, it disables the strategy.

So say I close out of CL 05-11 myself, NinjaTrader disables any running strategy on that same instrument.

My question is, has anyone figured out how to stop that from happening? I want the strategies to continue running even if I close out of a position myself.

Currently I'm doing the following, but it only works the first time:

 
Code
protected override void OnTermination()
{
    this.Enabled = true;
    this.Running = true;
}

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Increase in trading performance by 75%
The Elite Circle
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
Exit Strategy
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
27 thanks
Tao te Trade: way of the WLD
23 thanks
Diary of a simple price action trader
22 thanks
My NQ Trading Journal
14 thanks
GFIs1 1 DAX trade per day journal
9 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,440 since Jun 2009
Thanks Given: 33,207
Thanks Received: 101,599


It has been a long time, but I know what you are talking about, and I remember thinking there is a fix within the DOM itself. There is an option, but I just don't remember the name -- going on 2 years since I've used Ninja -- but basically a setting in DOM properties that will allow you to get past this.

But I recall it had some pretty major side effects. Just read the DOM help guide, it is in there somewhere.

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)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704

How often do you do this?

There's a reason for it. It's similar to the reason your car doesn't re-engage the cruise control after you've engaged the brakes.....

You're essentially saying "I don't like what's going on so I'm going to override it" and the strategy should remain off until you re-assess what's going on and turn it back on.

Think of it this way, if you exit a position manually, and the strategy was still active, it could in theory IMMEDIATELY enter you into a new position if the conditions were right.....so that's probably why the default is to turn it off....

But my original question stands....because if you don't do it often, then it shouldn't be a big deal to turn it back on when you've manually overridden it.

If you do it quite often, then you might want to consider simply using the confirmation setting, so it alerts you as to entries and exits, but you manually execute those.....

Reply With Quote
  #5 (permalink)
 
redratsal's Avatar
 redratsal 
Milan (I)
 
Experience: Advanced
Platform: Ninjatrader
Broker: Kinetick
Trading: FDAX,6E,CL,YM,NQ,ES
Posts: 1,648 since Oct 2010
Thanks Given: 1,215
Thanks Received: 2,090

Have you tried adding a timing variable:

protected override void OnTermination()
{
myTimer.Dispose();
}

Timer.Dispose Method (System.Threading)

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,713 since May 2010
Thanks Given: 203
Thanks Received: 2,686


RM99 View Post
How often do you do this?

There's a reason for it. It's similar to the reason your car doesn't re-engage the cruise control after you've engaged the brakes.....

You're essentially saying "I don't like what's going on so I'm going to override it" and the strategy should remain off until you re-assess what's going on and turn it back on.

Think of it this way, if you exit a position manually, and the strategy was still active, it could in theory IMMEDIATELY enter you into a new position if the conditions were right.....so that's probably why the default is to turn it off....

But my original question stands....because if you don't do it often, then it shouldn't be a big deal to turn it back on when you've manually overridden it.

If you do it quite often, then you might want to consider simply using the confirmation setting, so it alerts you as to entries and exits, but you manually execute those.....


This interpretation is correct for why strategies are disabled on hitting FLATTEN EVERYTHING or CLOSE a position. If you trade via ATM strategy, you can work around this by pressing the middle mouse button on the CLOSE button (instead of left mouse button) when you have an active ATM strategy selected. What this does is act upon the ATM Strategy position versus the account position.

An example...

- LONG 1 ES via NinjaScript Strategy
- LONG 1 ES via ATM Strategy

- Your account position is LONG 2
- If you close the position of the ATM strategy via method explained above, you will only sell 1 leaving the LONG 1 managed by your NinjaScript Strategy

Alternatively, you can just issue a manual order to close a portion or all of your position which will also leave your NinjaScript Strategy enabled.

Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on May 19, 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