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

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

Discussion in NinjaTrader

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

Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

Search this Thread

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

(login for full post details)
  #1 (permalink)
Newcastle, Australia
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received


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?

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
How to Register my Company in this Platform
Stocks and ETFs
RangeRider for NT8 V10
The Elite Circle
ACSIL and "Add Symbol Study"
Sierra Chart
Simple code to end my indicator
short positions
EasyLanguage Programming
Best Threads (Most Thanked)
in the last 7 days on futures io
Vinny E-Mini & Algobox Review TRADE ROOM
268 thanks
59 thanks
Would you share your Holy Grail?
56 thanks
Spoo-nalysis ES e-mini futures S&P 500
47 thanks
24 thanks
(login for full post details)
  #3 (permalink)
Experience: Intermediate
Platform: Ninja
Broker: Mirus/Zen
Trading: Futures - bonds, currencies, index
Posts: 288 since Oct 2010
Thanks: 70 given, 271 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
(login for full post details)
  #4 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
Big Mike's Avatar
Posts: 50,144 since Jun 2009
Thanks: 32,647 given, 99,014 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.


We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
(login for full post details)
  #5 (permalink)
Newcastle, Australia
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks: 108 given, 186 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?


Started this thread Reply With Quote
(login for full post details)
  #6 (permalink)
Experience: Beginner
Platform: MultiCharts
Posts: 240 since Nov 2010
Thanks: 10 given, 23 received

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 Trading Community Platforms and Indicators NinjaTrader > Testing of daily bars - In and out on same day.

Last Updated on September 25, 2012

Upcoming Webinars and Events

NinjaTrader Indicator Challenge!


Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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