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!
See more
See less

Partner 728x90

Collapse

8 day High

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

    8 day High

    Dear Ninjatrader Experts,

    I have a question refering the Strategybuilder. How can I implement the following condition:

    Intraday long position, after break through 8 day High

    Thank you for your great help in this forum,
    BR
    Harvard

    #2
    Hello Harvard,

    Thank you for writing in.

    When you open the builder, click next 3 times, add a secondary data series of day.
    Then on the conditions and actions section, add a condition. In price folder>Close set Series 1 to DataSeries>Primary Daily. Then set the operator to CrossAbove, and on the right side, in the Misc Folder, select HighestBar and Set Series1 to the Daily series as well, and period to 8.

    For do the following, select, EnterLong.

    You would then run the strategy on an intraday chart.

    You may need to consider adding additional logic to handle situations where each day is a new high, thus always giving a new signal.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot!

      Comment


        #4
        Hello AllanP,

        unfortunately the StrategyAnalyzer doesn't make a trade in the backtest. Can you help me please to find where my mistake is?

        Thanks,
        Harvard
        Attached Files

        Comment


          #5
          Hello,

          Thank you for the reply.

          I believe this instead should be using MAX with a Daily series. It looks like HighestBar was suggested which returns a BarsAgo rather than a Price. The CrossAbove is looking for a Price.



          Please try instead using the following in your condition:

          On the Left, select Price -> Close and leave the default input

          In the Center CrossAbove

          On the right side choose Indicator -> MAX
          Set its period to 8
          Under Data Series click where it says Default input -> Image
          On the list to the left click Data Series to expand the folder and select the Daily series
          On the right select High for the price type -> image

          the result


          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Thank you very much for your great support. Everything works fine. I love Ninjatrader

            Best Regards,
            Harvard

            Comment


              #7
              Is this also how you would use the Swing indicator to for example create a signal when something like a Fisher transform has reached a high pivot or low pivot and begun returning to the zero line?

              left side close // cross above // right side swing, upper or lower band, referring to the Fisher transform data series?
              Also when referring to bars ago is that INclusive to ALL bars up to, say 4 bars ago, or is it EXclusive to JUST the one bar, 4 bars ago?
              just wanting clarification of that.

              Originally posted by NinjaTrader_Jesse View Post
              Hello,

              Thank you for the reply.

              I believe this instead should be using MAX with a Daily series. It looks like HighestBar was suggested which returns a BarsAgo rather than a Price. The CrossAbove is looking for a Price.



              Please try instead using the following in your condition:

              On the Left, select Price -> Close and leave the default input

              In the Center CrossAbove

              On the right side choose Indicator -> MAX
              Set its period to 8
              Under Data Series click where it says Default input -> Image
              On the list to the left click Data Series to expand the folder and select the Daily series
              On the right select High for the price type -> image

              the result


              I look forward to being of further assistance.

              Comment


                #8
                Hello,

                Yes, a CrossAbove or CrossBelow would be the condition to use when checking if two series had crossed. This applies to any indicators that provide a series or plot to access. The Swing specifically may not work as intended when used for signals as it goes back over prior bars when a new swing is found to display the visual you see. Programmatically accessing this value would produce signals at other times along with when the swing happens so it may not work as expected as it is a visual indicator.

                In most cases, you can test these items by forming the syntax in the wizard and running it. If the result is not working as expected, you may need to unlock the code and Print the values being used to see what is happening in more detail.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  OK I think I understand, so something simpler to program such as comparing the current bar with the values say two or three bars ago would be more agile since you could simply combine that with a cross over condition.

                  IE: CCI crosses over an SMA of the CCI in the one condition and the current bar of the CCI not only is greater than or equal to any of the past 3 bars. But the low value you are coming out of is also the lowest position it had been for the past 10. I'll try writing some code to copy here that describes what I think would do this.

                  Originally posted by NinjaTrader_Jesse View Post
                  Hello,

                  Yes, a CrossAbove or CrossBelow would be the condition to use when checking if two series had crossed. This applies to any indicators that provide a series or plot to access. The Swing specifically may not work as intended when used for signals as it goes back over prior bars when a new swing is found to display the visual you see. Programmatically accessing this value would produce signals at other times along with when the swing happens so it may not work as expected as it is a visual indicator.

                  In most cases, you can test these items by forming the syntax in the wizard and running it. If the result is not working as expected, you may need to unlock the code and Print the values being used to see what is happening in more detail.

                  I look forward to being of further assistance.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Mizzouman1, Today, 07:35 AM
                  4 responses
                  18 views
                  0 likes
                  Last Post Mizzouman1  
                  Started by philmg, Today, 01:17 PM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_ChristopherJ  
                  Started by cre8able, Today, 01:01 PM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by manitshah915, Today, 12:59 PM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by ursavent, Today, 12:54 PM
                  1 response
                  4 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X