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.BrettNinjaTrader Product Management
-
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.
-BrettBrettNinjaTrader Product Management
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 cbabo, Today, 12:45 PM
|
0 responses
4 views
0 likes
|
Last Post
![]()
by cbabo
Today, 12:45 PM
|
||
Started by dwrety, 01-06-2025, 11:44 PM
|
1 response
35 views
0 likes
|
Last Post
![]()
by Reycastro
Today, 12:15 PM
|
||
Started by sofortune, Today, 10:29 AM
|
3 responses
12 views
0 likes
|
Last Post
|
||
Started by SilverSurfer1, Today, 10:00 AM
|
4 responses
13 views
0 likes
|
Last Post
![]() |
||
Started by gyilaoliver, Today, 09:34 AM
|
3 responses
17 views
0 likes
|
Last Post
|
Comment