NexusFi: Find Your Edge


Home Menu

 





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


Discussion in NinjaTrader

Updated
      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 3,604 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

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

  #1 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188

Hi,

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
ExitShortStop(Close[-1]);
But they don't work.

Thanks,
Neil.

PS
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 NexusFi?
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #3 (permalink)
 Xeno 
UK
 
Experience: Intermediate
Platform: Ninja
Broker: Mirus/Zen
Trading: Futures - bonds, currencies, index
Posts: 288 since Oct 2010
Thanks Given: 70
Thanks Received: 274


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)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,469 since Jun 2009
Thanks Given: 33,246
Thanks Received: 101,669

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.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188

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?

Neil.

Started this thread Reply With Quote
  #6 (permalink)
 bomberone1 
London
 
Experience: Beginner
Platform: MultiCharts
Posts: 277 since Nov 2010
Thanks Given: 14
Thanks Received: 29

Folks,
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




Last Updated on September 25, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts