disabling strategy after closed trade - NinjaTrader Programming | futures io social day trading
futures io futures trading


disabling strategy after closed trade
Updated: Views / Replies:115 / 3
Created: by sra18376 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 100,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
 

disabling strategy after closed trade

  #1 (permalink)
Trading Apprentice
kansas city, ks
 
Trading Experience: Intermediate
Platform: ninjatrader
Favorite Futures: stocks
 
Posts: 17 since Jun 2014
Thanks: 0 given, 5 received

disabling strategy after closed trade

I am building a strategy and would like for it to automatically 'disable' after a trade is closed.

essentially, i would like to have it set up where i pick a stock, start the strategy on it (starting the strategy immediately opens a long or short), and then when the parameters are met to close the trade, the trade is closed and the strategy stops.

I have achieved this thus far by having a bool flip on when i exit a long or short that prevents me from automatically entering another trade.

However when testing applying the strategy on a chart, it never stays enabled because the strategy starts on past candles on the chart instead of the current one and closes the trade before the current candle starts. this causes the bool to flip on before my current trade is able to even play out.

Is there a better way to achieve what i am trying to do? Or, is there a way to have the strategy not be applied to any of the prior data in a chart?

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)
Super Moderator
London UK
 
Trading Experience: Beginner
Platform: CQG
Broker/Data: S5
Favorite Futures: Futures
 
xplorer's Avatar
 
Posts: 4,238 since Sep 2015
Thanks: 10,400 given, 8,536 received



sra18376 View Post
I am building a strategy and would like for it to automatically 'disable' after a trade is closed.

essentially, i would like to have it set up where i pick a stock, start the strategy on it (starting the strategy immediately opens a long or short), and then when the parameters are met to close the trade, the trade is closed and the strategy stops.

I have achieved this thus far by having a bool flip on when i exit a long or short that prevents me from automatically entering another trade.

However when testing applying the strategy on a chart, it never stays enabled because the strategy starts on past candles on the chart instead of the current one and closes the trade before the current candle starts. this causes the bool to flip on before my current trade is able to even play out.

Is there a better way to achieve what i am trying to do? Or, is there a way to have the strategy not be applied to any of the prior data in a chart?

You could add a condition the checks whether the PnL is different from zero.

Reply With Quote
 
  #4 (permalink)
Elite Member
United States
 
Trading Experience: None
Platform: MT4,TWS,Ninja Trader
Favorite Futures: Forex
 
cutzpr's Avatar
 
Posts: 30 since Apr 2012
Thanks: 9 given, 6 received

You would want to do something like this.
 
Code
                            


if(State == State.Historical) return; //It will not continue if bars are historical, only realtime

If(SignalEnter)
{
enter market
}

if(
SignalExit)
{
exit 
market // exit market
foreach (Order o in Orders// Cancel all pending orders 
{
Cancel(o);
}
CloseStrategy() // Close and exit Strategy


Reply With Quote
The following user says Thank You to cutzpr for this post:

Reply



futures io > > > > > disabling strategy after closed trade

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Journal Challenge $1600 in Prizes & Free Journalytix for all participants!

February
 

3 Excellent Entries, and How To Automate Them w/Kevin Davey

Feb 21
 

The Driving Force Behind the Market w/Earn2Trade

Mar 5
 

TBA w/Stage5 & iSystems

Mar 12
 

TBA w/John Grady @ No BS Day Trading

Mar 19
 

Day Trading Oil Futures: Reducing Risk & Increasing Profits w/DTN IQFeed

Mar 26
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling CompatTelRunner for Windows boot speedup ratfink Platforms and Indicators 3 June 5th, 2017 11:46 AM
NT7 - Strategies not fully isolated and disabling each other when using Add() for FX warcious NinjaTrader Programming 3 November 7th, 2016 12:46 AM
Disabling strategy trades AstralTrader NinjaTrader 0 January 27th, 2014 06:46 PM
Why would crude make high after crude pit is closed? bradkop Commodities Futures Trading 48 August 18th, 2013 11:24 AM
Stop strategy disabling when position closed. phantogram NinjaTrader Programming 5 May 19th, 2011 10:29 AM


Tags
data, information, ninjascript, ninjatrader, orders, short, strategy

All times are GMT -4. The time now is 07:35 PM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business, 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 2019-02-20 in 0.16 seconds with 13 queries on phoenix