NexusFi: Find Your Edge


Home Menu

 





Buy on Close(Today)


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Mondrakete with 2 posts (0 thanks)
    2. looks_two MXASJ with 1 posts (0 thanks)
    3. looks_3 sam028 with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,997 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
Mondrakete
Germany
 
Posts: 24 since Feb 2011
Thanks Given: 1
Thanks Received: 0

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!

Stephan


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran War Prediction Markets: Ceasefire 16%, Ground Invas …
Prediction Markets & Event Contracts
Kalshi Rockets to $22B, Passes Polymarket in Volume -- B …
Prediction Markets & Event Contracts
Synapse Pro - Trade Copier with topstep and MT5 integrat …
NinjaTrader
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
MegaETH Proves the Crowd Right: Prediction Markets Calle …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632


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.


Success requires no deodorant! (Sun Tzu)
Follow me on X Reply With Quote
  #4 (permalink)
Mondrakete
Germany
 
Posts: 24 since Feb 2011
Thanks Given: 1
Thanks Received: 0

-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
  #5 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 801

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




Last Updated on March 2, 2011


© 2026 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 - Downloads - Top
no new posts