Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Buy on Close (Today)
Collapse
X
-
Intraday, for most cases, there is no difference between the close of one bar and the open of the next. However, if this must be coded as you seem to want, then your only real choice is to calculate the time the bar will close, and exit at that time. On a fixed time frame chart, you know the time the last bar closed (Close[1]), so you merely need to add the time for your chart period to that time, and set the exit based on that time.Originally posted by capstonetrader View PostThanks, the best I could do in the Ninja Script was:
If (ToTime(Time[0]) == 1200 && Close[0]>=0)
{
ExitShort("exit signal name", "entry signal name");
}
It would not let me compile if I just state:
Then ExitShort This Bar on Close;
after the Time and Close >= 0 condition.
So with the Ninja script above, it still exits at the open of the next bar instead of the close of the current bar.
Comment
-
Q
Bertrand when you say "this is nt's conservative approach" are you suggesting this because although it occurs, the close of one bar and the open of another are not always equal and in real time / real life....If a close is gone, its in the past and the price cannot be accessed by a limit order or such if the price has moved against you by the open of the next bar?Originally posted by NinjaTrader_Bertrand View PostThis would be expected in backtesting capstonetrader, after your exit triggers then next possible trade location is the open of the next bar, this is NT's conservative approach here.
Meaning its more realistic....
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
598 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
557 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment