Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Closing above a moving average ...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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!

    #2
    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

    Comment


      #3
      thank you Brett!

      Comment


        #4
        another question .. I want to make sure that a trade is not executed after 3:00PM or a time that is set by a variable ... is there a way I can program that as a condition in my strategy?

        Comment


          #5
          Hi pman777,

          You could create this in the condition builder. You would add a time filter to your entry conditions. For help please see the following link:

          Then expand section: How to create time comparisons
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            thanks ... that worked.

            Also, is there a way to set a condition that identifies whether a bar is 'green' or 'red'?

            Comment


              #7
              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
              BrettNinjaTrader Product Management

              Comment


                #8
                thanks Brett .. .can you direct me to documentation or an example that I can use to guide me through this in more detail?

                Comment


                  #9
                  Hello,

                  No documentation to point to in exact detail on this specific setting.

                  However there is general documentation on setting Do The Following conditions.



                  Let me know if I can be of further assistance.
                  BrettNinjaTrader Product Management

                  Comment


                    #10
                    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


                      #11
                      Yes this is different.

                      To test this you need to test is Close[0] is greater then the Open[0]. This is a green bar or an up bar.

                      Use the reverse for a down bar.

                      -Brett
                      BrettNinjaTrader Product Management

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by cbabo, Today, 12:45 PM
                      0 responses
                      4 views
                      0 likes
                      Last Post cbabo
                      by cbabo
                       
                      Started by dwrety, 01-06-2025, 11:44 PM
                      1 response
                      35 views
                      0 likes
                      Last Post Reycastro  
                      Started by sofortune, Today, 10:29 AM
                      3 responses
                      12 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by SilverSurfer1, Today, 10:00 AM
                      4 responses
                      13 views
                      0 likes
                      Last Post SilverSurfer1  
                      Started by gyilaoliver, Today, 09:34 AM
                      3 responses
                      17 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Working...
                      X