I'm just curious in the context of the strategy builder -- I am not a programmer.
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
Automated strategy - bars ago if MACD was greater than or less than the AVG?
Collapse
X
-
Automated strategy - bars ago if MACD was greater than or less than the AVG?
Is there a way to see if 2 or 3 bars ago in strategy builder the blue line was under the red line on the MACD indicator?
I'm just curious in the context of the strategy builder -- I am not a programmer. -
Hello MatthewLesko,
In the condition builder select MACD on the left. Set Bars ago to 2 (or 3 depending which actually want) for the Plot select the MACD plot. In the center select Less than. On the right select the MACD, set Bars ago to 2 (or 3), for the Plot select the Avg plot.
If you have not already, be sure to watch the Strategy Builder 301 training video which demonstrates selecting a plot from the MACD indicator.
Chelsea B.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_ChelseaB View PostHello MatthewLesko,
In the condition builder select MACD on the left. Set Bars ago to 2 (or 3 depending which actually want) for the Plot select the MACD plot. In the center select Less than. On the right select the MACD, set Bars ago to 2 (or 3), for the Plot select the Avg plot.
If you have not already, be sure to watch the Strategy Builder 301 training video which demonstrates selecting a plot from the MACD indicator.
https://ninjatrader.com/support/foru...040#post786040
So if I have "1 bars ago" on the left side, it's referring to the state of MACD for bar #3?
And if I have "1 bars ago" on the right side, it's referring to the state of MACD for bar #2?
Comment
-
Hello MatthewLesko,
Where you mention: "and I'm at the start of a 4th bar", does this mean this is real-time data with Calculate set to OnEachTick or historical with TickReplay?
https://ninjatrader.com/support/foru...377#post773377
Below is a link to the help guide on how bars are referenced.
https://ninjatrader.com/support/help...taIsReferenced
When Calculate is OnEachTick, the most recently updated bar (Bars Ago 0) is the currently building bar. When Calculate is OnBarClose, the most recently updated bar is the most recent fully closed bar.
So.. if you are at the start of the 4th bar, this would imply Calculate.OnEachTick, IsFirstTickOfBar is true, and BarsAgo 0 refers to the first tick of the new bar. BarsAgo 1 is the previous fully closed bar.
Or are you using Calculate OnBarClose, and you are referring what happens to an order after it is submitted when a bar has fully closed (and fills at the open of the next bar)?
Where you have mentioned:
So if I have "1 bars ago" on the left side, it's referring to the state of MACD for bar #3?
Using Bars Ago 1 with the MACD indicator when Calculate is OnEachTick would return the plot value for the selected plot (MACD plot by default) of the most recently fully closed bar. So the most recent MACD value of the most recent fully closed bar.
Where you have mentioned:
And if I have "1 bars ago" on the right side, it's referring to the state of MACD for bar #2?
Your original inquiry was:
Is there a way to see if 2 or 3 bars ago in strategy builder the blue line was under the red line on the MACD indicator?
Yes, compare the value of the plot from 2 (or 3) bars ago of the Diff plot on the left, select less than in the center, and the value of the plot from 2 (or 3) bars ago of the with the Avg plot line on the right.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Aviram Y, Today, 05:29 AM
|
0 responses
1 view
0 likes
|
Last Post
by Aviram Y
Today, 05:29 AM
|
||
Started by quantismo, 04-17-2024, 05:13 PM
|
3 responses
25 views
0 likes
|
Last Post Today, 05:23 AM | ||
Started by ScottWalsh, 04-16-2024, 04:29 PM
|
7 responses
34 views
0 likes
|
Last Post Today, 05:15 AM | ||
Started by cls71, Today, 04:45 AM
|
0 responses
6 views
0 likes
|
Last Post
by cls71
Today, 04:45 AM
|
||
Started by mjairg, 07-20-2023, 11:57 PM
|
3 responses
216 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
Comment