Stop strategy disabling when position closed. - NinjaTrader Programming | futures io social day trading
futures io futures trading


Stop strategy disabling when position closed.
Updated: Views / Replies:3,940 / 5
Created: by phantogram Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Stop strategy disabling when position closed.

  #1 (permalink)
Trading Apprentice
Dallas, TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES,SI,CL
 
Posts: 5 since May 2011
Thanks: 0 given, 0 received

Stop strategy disabling when position closed.

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
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,233 received


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

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #4 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received

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)
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,068 received

Have you tried adding a timing variable:

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

Timer.Dispose Method (System.Threading)

Reply With Quote
The following user says Thank You to redratsal for this post:
 
  #6 (permalink)
Elite Member
Denver, CO
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: NinjaTrader Brokerage
Favorite Futures: ES
 
NinjaTrader's Avatar
 
Posts: 1,260 since May 2010
Thanks: 153 given, 1,890 received


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.

Reply With Quote
The following 2 users say Thank You to NinjaTrader for this post:

Reply



futures io > > > > > Stop strategy disabling when position closed.

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Call ATM Strategy on an automated strategy to control position jsengxx NinjaTrader Programming 7 May 31st, 2016 05:51 PM
Contract Rollover: Adopt Real World Position and manage per previous position entry RM99 EasyLanguage Programming 3 May 30th, 2012 07:55 AM
Volume stop Strategy Possible ? isarhodes NinjaTrader Programming 5 July 12th, 2011 05:02 PM
MOVE STOP LOSS AFTER STRATEGY firecan NinjaTrader Programming 2 December 13th, 2010 06:54 AM
Add to original position in NinjaTrader Strategy ryohkyo NinjaTrader Programming 5 March 14th, 2010 11:48 PM


All times are GMT -4. The time now is 05:14 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-14 in 0.11 seconds with 19 queries on phoenix via your IP 54.221.73.186