Buy on Close(Today) - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Buy on Close(Today)
Started:March 1st, 2011 (02:55 PM) by Mondrakete Views / Replies:1,806 / 4
Last Reply:March 2nd, 2011 (08:19 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Buy on Close(Today)

Old March 1st, 2011, 02:55 PM   #1 (permalink)
Trading Apprentice
Futures Experience: Beginner
Platform: Ninja Trader
Favorite Futures: Stocks
Posts: 24 since Feb 2011
Thanks: 1 given, 0 received

Buy on Close(Today)

Hi folks,

I'm pretty new to NT and Mike's forum.
I'm challenged by a actually simple, but with NT seemingly unfeasable aproach.
I want to implement a simple strategy based on daily data that operates on a Close to Close base.
The logic is going to be:

If the Close today is higher than the Close yesterday, buy on today's close and sell at tomorrows close.
Short analog.

The system is always in market and it's backtesting only.
NT Support already told me that this kind of apprach is unpossible at least using the managed approach of ordering.

Does anybody know how to solve that issue, if necessary using the unmanged approach?
One has to force NT somehow to execute the order on the bar where it's generated and to
excecute it at the Close-price of the today's bar..
Using Index -1 within managed approach yields to weird behavior, not all orders are excecuted.

Any ideas or should I forget about NT?

Cheers and thanks in advance!


Reply With Quote

Old March 1st, 2011, 02:55 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Old March 1st, 2011, 03:27 PM   #3 (permalink)
Administrator: Retired Backtester
Rennes France
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
sam028's Avatar
Posts: 3,187 since Jun 2009
Thanks: 3,429 given, 3,727 received

The problem is that you have this information:
1#"If the Close today is higher than the Close yesterday"
at the close itself, so it's too late to
2#"buy on today's close"...
An idea is maybe to add another time frame, let's say a 10 seconds bar, and not use the Close for 1# but the Close minus 10 seconds.

Usually in trading, those who know don't talk, and those who talk don't know. (Al Brooks)
success requires no deodorant! (Sun Tzu)
Reply With Quote

Old March 1st, 2011, 03:58 PM   #4 (permalink)
Trading Apprentice
Futures Experience: Beginner
Platform: Ninja Trader
Favorite Futures: Stocks
Posts: 24 since Feb 2011
Thanks: 1 given, 0 received

-Unfurtunately I don't have another timeframe, it's daily data only back to the 70's.
I tried it like this:

if (Close[-1] >Close[0])
EnterLongLimit(1, Close[-1], "Long-Entry");

short analog,

and to exit on the actual bar with:

if (BarsSinceEntry("Long-Entry") == 0 )

ExitLongLimit(Close[-1], "Exit Long", "Long-Entry");

In case of a reversion NT generates a close oder by itself and
I used some code to suppress strategy generated exit orders in this case.
But it still doesn't always work. NT suppresses some of the entry orders.
According to support managed orders are not able to deal with [-1].

May be an unmanaged order system helps me out-but I'm totally new to this approach and don't know
if that might work.

Reply With Quote

Old March 2nd, 2011, 08:19 PM   #5 (permalink)
Elite Member
Futures Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 798 since Jun 2009
Thanks: 109 given, 784 received

Futures Edge on FIO

How much money do you need to trade futures successfully?

It has been pretty well explained here: Buy on Close (Today) - NinjaTrader Support Forum

and in Sam's comments.

Use Excel or Matlab instead... something that doesn't care if you are violating reality .

Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Buy on Close(Today)

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
New margins for gold, silver, etc from market close today MXASJ News and Current Events 0 January 20th, 2011 11:13 PM
ZN close JTrain Bonds and Interest Rates Trading 1 January 10th, 2011 10:51 AM
Volitility indicator question - Open - Open / open - close / close to open andresimon NinjaTrader 2 September 27th, 2010 12:33 AM
Close[0] not waiting until bar close dsraider NinjaTrader Programming 4 February 11th, 2010 05:49 PM
Buy@Ask - Buy@Bid !!! RJay Traders Hideout 15 September 5th, 2009 09:30 PM

All times are GMT -4. The time now is 06:56 PM.

Copyright © 2016 by 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

Page generated 2016-10-25 in 0.08 seconds with 19 queries on phoenix via your IP