Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to buy at the closing price on current bar?
Collapse
X
-
Your condition will never evaluate to true.
High[0] compared to MAX(High, 5)[0]. MAX(High, 5)[0] gives you the highest high over the last 5 bars. High[0] is included in the MAX() check. If it is in the check it will be impossible for High[0] to be greater than MAX(). If it was the highest it would be the MAX().Josh P.NinjaTrader Customer Service
Comment
-
OK...now we come back to the original question. NT is triggering alright but it is buying in the open of the next bar. Now....this delay is not nescessary. I want to enter the trade the moment it crosses the highest high of the past 5 days - in the very same day it crosses and at the very same price. There is no logical impediment for it, so there must be a way.
Is that possible?
-geo-
Comment
-
Josh, now we must talk very seriously :>)))
I could agree with the fact that indicators "close" their value with the close of the bar. But if my system is about crossing a certain value - that is quite different!!
If the present bar is crossing a certain threshold, a certain value, be it an EMA, or SMA, or HHV of a previous bar, there is absolutely no logical impediment to execute the triggered order at the present bar and at the
price where the crossing occurred. I agree that the price could have crossed it 10 times forth and back - but it HAS crossed it at that precise value. Where is the impediment?
The impossibility to program NT to do that IS a serious problem - so much that I still believe that through scripting it MUST be possible to do it.
Again: indicator calculations are made at the close of the bar, but crossings???? No. There must be a way to solve this. If not now...in some future edition of NT.
Consider STOPS. If prices "CROSS" a STOP today will I not be triggered out of the trade? Well then...why not when prices cross an EMA?
I am not talking about the "picture" of the candle being crossed by an EMA. That is past, fixed and can not be changed. What I am talking about is about the capacity of NT to calculate and signal entries at the precise crossing point. We are backtesting. That calculation is done AFTER the closing of the present bar. The arrow is positioned there after the bar is closed - and it should not be a problem.
rgds
-geo-
Comment
-
Geo,
Crossings, indicator values, bar values, everything else, during a backtest, all are evaluated at the close of the bar. As discussed several times already, NinjaTrader will always take the most conservative approach possible. You cannot trade at the close price in a backtest.
If you want real-time behavior just run forward tests and skip the backtesting. The fact of the matter is that this is the nature of backtesting. Any behavior otherwise is "cheating" and NinjaTrader disallows this to prevent overstating of performance. Unfortunately I cannot devote any more resources discussing this point.Josh P.NinjaTrader Customer Service
Comment
-
Josh,
I understand that you cannot devote any more resources discussing this point. No problem, really. We will not talk this over again.
I am not speaking out of my elbows - as we say over here - meaning that I am not some discussion lover.... or something like that. I have been studying, analyzing and trading systems of all kinds for many years now. My present conclusion is that in no way can one put all situations and circumstances in one single basket.
-- Opening a position at close is not allowed because in the final 5 or 3 or 10 or 1 minute the market may change and indicators may move abruptly. OK, agreed.
-- Price crossing a previous high is FINAL. It is an irrevocable, unchangeable, absolute fact. Not only that, but the exact point of crossing can be precisely pinpointed.
There is no cheating in it. As the bar closes and the tester sees that there was a crossing it exits you at that price because that is what you would do in real life trading.
Back testing means testing the past. It is looking into the near or distant past. The tester may look into the last bar and see the crossing point - in the past, just like any other past events in the chart. Just as it exits you if prices fall bellow your Stop-Loss trigger. What is the difference? Where is the cheating?
Sorry if I am being so insistent...maybe the result of a touch of disappointment. I still believe that this can be somehow be overcome through scripting.
rgds
-geo-
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
63 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
139 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|

Comment