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 was hoping to find a very simple Day of Week, and possibly Day of Month strategy to buy the open and sell the close each day to test weekly or monthly bias. I have not been able to find anything yet for NinjaTrader. Apologies if it is already here and I missed it. Could anyone help? I am not a programmer and have stumbled around trying to create it from scratch.
I should add that I am simply using daily charts with end of day data.
Can you help answer these questions from other members on NexusFi?
You can't buy at the open of a bar and sell at the close of the same bar with Ninjatrader. The orders will always happen at the open of the next bar so you'll have to deal with overnight gaps.
The way around this limitation with Ninjatrader is to use a lower time-frame bar to execute your trades on. If you're wanting to do this with daily bars you'll need intraday data/bars for the order execution.
The other way is to use a two-pass approach: run through the daily bars and cache the closing price of each bar in the first pass. Then, in the second pass through the data enter your trade as normal and place a limit or stop order to exit at the already-known closing price so the trade will occur at the closing price of the day. That's a little trickier to code though.
I, too, ran into this problem. . was initially frustrated at the inability to do something so simple within ninja, as well as frustrated at the fact that 'exit on close' does not, actually, exit on close, when you're using 1-day bar increments.
Hodson is right. . and I've just programmed a few templates to do precisely what you're doing, feel free to msg me if you'd like the code!