I am looking to define a condition that identifies when the median price crosses above the 50 SMA and stays above for 3 bars (or whatever amount that is defined by a user parameter). The key is that the 3 bars, in this example, must all remain above the 50 SMA. Can someone assist on how I can define this via the wizard. Thanks in advance!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Closing above a moving average ...
Collapse
X
-
Closing above a moving average ...
Hello ... I'm not a programmer so I rely on the wizard to define my strategies.
I am looking to define a condition that identifies when the median price crosses above the 50 SMA and stays above for 3 bars (or whatever amount that is defined by a user parameter). The key is that the 3 bars, in this example, must all remain above the 50 SMA. Can someone assist on how I can define this via the wizard. Thanks in advance!Tags: None
-
Hello,
Thanks for the note.
You can do this manually in the condition builder by checking for is the Close price of the current bar is > SMA and Close price of 1 bar ago is > SMA then finally close price of 2 bars ago what > SMA.
You would need to program the strategy to hard code it how many bars to check against.
To have a variable number of bars to check against this unfortunately would require unlocking the code and manual coding.
Let me know if I can be of further assistance.
-
Hello,
Glad to hear that worked.
You can do this by setting your own condition to do this then in the Do The following section on the Conditionas and Actions page in the strategy wizard click Add. Expand out Drawing and then select Set Bar Color and optionally use Set candle outline color as well.
-Brett
Comment
-
Not sure if I made my self clear on what I want to accomplish. For example, I want to know whether the 2 bars preceding the current bar that has crossed above the 50 PMA were green or not ... to do this, I need to be able to test whether certain bars, looking back, are green or red. Does this help? tx!
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by timmbbo, Today, 08:59 AM
|
1 response
2 views
0 likes
|
Last Post Today, 09:16 AM | ||
Started by KennyK, 05-29-2017, 02:02 AM
|
2 responses
1,279 views
0 likes
|
Last Post
by marcus2300
Today, 09:13 AM
|
||
Started by fernandobr, Today, 09:11 AM
|
0 responses
2 views
0 likes
|
Last Post
by fernandobr
Today, 09:11 AM
|
||
Started by itrader46, Today, 09:04 AM
|
1 response
6 views
0 likes
|
Last Post Today, 09:10 AM | ||
Started by bmartz, 03-12-2024, 06:12 AM
|
5 responses
33 views
0 likes
|
Last Post Today, 08:34 AM |
Comment