Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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.
Can you help answer these questions from other members on NexusFi?
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.