Testing of daily bars - In and out on same day. - NinjaTrader Programming | futures io social day trading
futures io futures trading

Testing of daily bars - In and out on same day.
Updated: Views / Replies:1,666 / 5
Created: by NW27 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 dont 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

Thread Tools Search this Thread

Testing of daily bars - In and out on same day.

  #1 (permalink)
Elite Member
Newcastle, Australia
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks: 108 given, 178 received

Testing of daily bars - In and out on same day.


I'm using daily bars.
How do I create a strategy that only lasts one day?
As an example, say an OOPS strategy

Where the day opens below the prior day
Buy the Open and sell at the close
OR Buy on stop at yesterdays low and sell on the close.

In the OnBarUpdate method, I have -
If (Open[+1]<Low[0])
EnterLongStop(DefaultQuantity, Low[0]+1, "LE");

This works and gets me in BUT how do I exit at the close of the day?

I've tried things like
But they don't work.


I do have down to 1 min data but I'm not sure on how to reference Yesterdays High,Low,Close etc from inside a 1min/5min bar?

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
Futures Experience: Intermediate
Platform: Ninja
Broker/Data: Mirus/Zen
Favorite Futures: Futures - bonds, currencies, index
Posts: 288 since Oct 2010
Thanks: 70 given, 267 received

Two suggestions - have two bars series, one daily and one 1 min, and control things on the 1 min one. See the Ninja docs for multi timeframe

You could also try setting ExitOnClose = true, and ExitSeconds to how many seconds to close before the session close. Not sure if that works, but it might.

Reply With Quote
  #4 (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,430 since Jun 2009
Thanks: 29,510 given, 84,408 received

You also need to keep in mind Ninja has major major limitations in this area regarding accuracy.

For instance:
Day opens @ 74.00
Day high @ 76.00
Day low @ 72.00
Day close @ 73.00

If you buy at the open (74.00) and have a profit target of 75.50, Ninja will say you hit your profit target even if your stop was higher than the day low.

That is because Ninja assumes a best case scenario when dealing with data on the same bar. MultiCharts has the option (and is by default) going to assume a worst case scenario on such events. Now maybe NT changed this in the year since I've used it, but I don't think so.

So just be aware of such a huge limitation and you need to probably use minute data to test with, not daily bars, to get around it.


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.
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
  #5 (permalink)
Elite Member
Newcastle, Australia
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks: 108 given, 178 received

Hi Mike,

Thanks for the reply.
I have gone from Metastock to Bullcharts(Daily) with Tradesim to TS2000i (pirate copy) to Amibroker and IB Traderworkstation and now NT7.
I'm trying to trade like Al Brooks by simply using price actions alone and I really like the NT ATM strategy. This allows me to right click on the chart, place a stop order and everything else gets created for me. I don't have to sweat about getting a initial stop in, setup a trailing stop etc. Then relax and fine tune.
BUT, I have just spent the last two days fighting the NT language, trying to create and test a strategy for my father.
Basically enter on traps.
I am a programmer by trade, admittedly pascal, assembler etc but it's not the C construct it's bloody NT.
Why is something so simple so hard. Trying to get yesterdays OHLC and by on a transition of one of these.

You keep referring to Multicharts and you have probably answered this question a million times here already but whats so great about it that kills NT? Why make the big change?
And yes I do appreciate the huge learning curve again. So it must be something monumental that has changed you?


Reply With Quote
  #6 (permalink)
Elite Member
Futures Experience: Beginner
Platform: MultiCharts
Posts: 236 since Nov 2010
Thanks: 10 given, 20 received

OOPS Larry Williams

I am trying to use Larry Williams, OOPS.

Is there anyone that could post the oops indicator and strategy by Larry Williams by easylanguage multicharts?

Avoid to change the code, Using the strategy by default, do you find what is the best Futures or ETF and on wich is the best time frame that works better?

My best

Reply With Quote


futures io > > > > > Testing of daily bars - In and out on same day.

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

July Journal Challenge - $500 in Amazon Gift Cards!


AXESS Trader: Powerful Cloud Based Trading Platform w/GFF Brokers

Jul 17

TBA: FuturesTrader71 w/Morad Askar

Elite only

Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyLanguage Daily Profit and Daily Loss limit in strategy Big Mike EasyLanguage Programming 11 May 12th, 2016 01:50 PM
Daily Hi low indicator (testing) marioc NinjaTrader Programming 6 May 6th, 2011 09:18 AM
End Of Day Daily Bars tapid Reviews of Brokers and Data Feeds 5 March 29th, 2011 07:55 AM
I need tick file of one day of history of ES for testing Crassius NinjaTrader Programming 2 February 27th, 2011 07:22 PM
Calculate GAP (Close of Prior Day, Open of Current Day) bluemele NinjaTrader Programming 16 January 19th, 2011 09:19 PM

All times are GMT -4. The time now is 07:41 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-07-17 in 0.12 seconds with 14 queries on phoenix