https://ibb.co/k7DyO5
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Builder buy when should not
Collapse
X
-
Hello lorenzoP,
When you applied the strategy, likely you are running the strategy with Calculate set to OnBarClose, which means that the strategy waits until the bar closes before evaluating if the condition is true or false. Thus, on the bar before the entry on your image, your conditions were true and an order was submitted to buy on the open of the next bar.
I put together a screen shot explaining this point.
Please see Calculate section of our helpguide,
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
-
Hi, thanks, i treid with calculate on each tick, but there are still error;
could you please tell me how to do that?
buy when the last 2 bar are green
sell when the last 2 bar are red
(im going to try using a ema with period 3 or 2, if raising buy, if falling sell, could this work?)
Comment
-
Hello lorenzoP,
By error are you referring to an actual error message or the strategy not behaving like expected?
The way your strategy is set up would in real time behave as expected, with calculate set OnEachTick.
Historical trades are going to be plotted as if calculate was set to OnBarClose. Adding a secondary data series of type tick, and submit orders to that series, should provide more accurate historical trade results by taking away the issue where the trade is not entered on the bar the condition becomes true, but rather on the open of the following bar.
You should see the following post on intrabar granularity,
I look forward to your reply.Alan P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ghoul, Today, 06:02 PM
|
2 responses
11 views
0 likes
|
Last Post
by ghoul
Today, 06:36 PM
|
||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
44 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
20 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
180 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
||
Started by DanielSanMartin, Yesterday, 02:37 PM
|
2 responses
13 views
0 likes
|
Last Post Today, 05:26 PM |
Comment