NexusFi: Find Your Edge


Home Menu

 





Long on Open exit on Close Help please


Discussion in NinjaTrader

Updated
    1. trending_up 1,380 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Long on Open exit on Close Help please

  #1 (permalink)
 
iPipper427's Avatar
 iPipper427 
Atlanta + GA/USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Forex
Posts: 34 since Jul 2012
Thanks Given: 57
Thanks Received: 14

I am trying to program what you think would be a simple program...Yet I am struggling..Please help
I would like to test based on entering trades on the open of a time frame (i.e 5min,30min,1hr,4hr etc.)
and then exiting on the close of that bar or timeframe... This seems to be more difficult than I thought as I have only novice programming experience.. Any Help or a nudge in the right direction on this would be greatly appreciated. This is for backtesting purposes.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Increase in trading performance by 75%
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,976 since Jun 2009
Thanks Given: 533
Thanks Received: 3,709



iPipper427 View Post
I am trying to program what you think would be a simple program...Yet I am struggling..Please help
I would like to test based on entering trades on the open of a time frame (i.e 5min,30min,1hr,4hr etc.)
and then exiting on the close of that bar or timeframe... This seems to be more difficult than I thought as I have only novice programming experience.. Any Help or a nudge in the right direction on this would be greatly appreciated. This is for backtesting purposes.

There is no simple way to do it with Ninjatrder. By default, orders happen at the open of the next bar, at least in backtests. The only alternative with Ninjatrader is to use a lower time-frame bar to execute orders on, but even that is not perfect. So if you have daily bars and you want to enter at the close, you can, say, have a second price series of 1min bars and if you want to exit on the close at 4pm you have to examine the 1min bar and do your executions at 3:59 just before it closes. Or some variation of that. The smaller the timeframe of your secondary data series, the longer your backtests will take to run.

You should read through this and look at the "SampleMultiTimeFrame" sample strategy that comes with Ninjatrader.

To be honest, it's not much of an issue with intradtay data, which usually doesn't have gaps, but if you're dealing with daily bars it's a much bigger issue.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on August 26, 2015


© 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