to get NT to perform an action only once while a strategy condition is true - NinjaTrader Programming | futures io social day trading
futures io futures trading


Notices

to get NT to perform an action only once while a strategy condition is true
Updated: Views / Replies:1,365 / 3
Created: by richw 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
 

to get NT to perform an action only once while a strategy condition is true

  #1 (permalink)
Market Wizard
Salt Lake City, UT
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: NinjaTrader Brokerage
Favorite Futures: CL, ES, NQ, YM
 
richw's Avatar
 
Posts: 1,120 since May 2010
Thanks: 937 given, 801 received
Forum Reputation: Legendary

to get NT to perform an action only once while a strategy condition is true

...only once while a strategy condition it true? (Wait for the condition to be false and then take action only once when the condition turns true again.)

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)
Elite Member
Asia
 
Futures Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 790 received


Untested but try something like this:

 
Code
#region Variables

privatebool myFlag = false; // Default setting for MyFlag

#endregion

protectedoverridevoid Initialize()
{
CalculateOnBarClose = true;
}

protectedoverridevoid OnBarUpdate()
{
if (historical) return;
if (Close[0] > Close [1] && myFlag == false)
{
Print(DateTime.Now + " It's going up!");
myFlag = true;
}
else myFlag = false;


}

Reply With Quote
The following 4 users say Thank You to MXASJ for this post:
 
  #4 (permalink)
Market Wizard
Salt Lake City, UT
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: NinjaTrader Brokerage
Favorite Futures: CL, ES, NQ, YM
 
richw's Avatar
 
Posts: 1,120 since May 2010
Thanks: 937 given, 801 received
Forum Reputation: Legendary

Thanks for the response

That should work nicely.

Reply With Quote

Reply



futures io > > > > > to get NT to perform an action only once while a strategy condition is true




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

How to use the Footprint Tool to Execute Trades w/Brannigan Barrett

Elite only
 

Ask Me Anything (Brokers & Platforms) w/Ilan Levy Mayer @ Cannon Trading

Dec 13
 

Battlestations! Show us your trading desks w/GFF Brokers ($750 in Prizes)

January
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Price Action Indicator for NT 6.5 Rashid NinjaTrader 1 April 5th, 2011 01:45 AM
Simple template to convert NT Strategy to NT IUndicator visounds NinjaTrader Programming 4 March 31st, 2011 08:16 AM
Can Ninjatrader perform autotrading without problems? waveraider NinjaTrader 26 February 7th, 2011 08:19 AM
Strategy Condition Logic >> my wetware Trader.Jon NinjaTrader Programming 2 May 24th, 2010 05:17 PM
True High and True Low kaywai NinjaTrader Programming 4 January 20th, 2010 04:09 PM


Tags
code, es, information, ninjascript, ninjatrader, strategy

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

Copyright © 2018 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 2018-12-09 in 0.09 seconds with 14 queries on phoenix