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

way to say whole crossover less than

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

    way to say whole crossover less than

    i'm trying to say in my strategy if the whole crossover is less than bollinger line. but, i don't see how i can. i can say if one of the sma lines is less than the bollinger but it spans lower than the bollinger line and higher than the line in the same bar. so it doesn't work.

    #2
    Hello SteveReiza,

    Thank you for your post.

    Are you building the strategy in the Strategy Builder or is it an unlocked script in the NinjaScript Editor? By "whole crossover" what exact value are you referring to? Please provide a more concrete example of what values you are checking in the crossover and an example of what those values would be compared to the bollinger when the condition is met.

    I look forward to your clarification.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      thanks for the reply. i'm using strategy builder. but, i could unlock the code and adjust. i'm trying to say if smaX crosses over smaY two bars ago and is greater than bollinger line Z; enter. if i just say, if smaX greater than bollinger line 3 bars ago. its not true. its like the crossover happens just above the line. so the start of the smaX line at that bar is below the bollinger line i'm refering to. so my thinking is just say the cross over occurs greater than the bollinger line.

      Comment


        #4
        Originally posted by SteveReiza View Post
        thanks for the reply. i'm using strategy builder. but, i could unlock the code and adjust. i'm trying to say if smaX crosses over smaY two bars ago and is greater than bollinger line Z; enter. if i just say, if smaX greater than bollinger line 3 bars ago. its not true. its like the crossover happens just above the line. so the start of the smaX line at that bar is below the bollinger line i'm refering to. so my thinking is just say the cross over occurs greater than the bollinger line.
        You mention "if smaX crosses over smaY two bars ago and is greater than bollinger line Z"
        There is no value assigned for cross above or cross below conditions.
        "so the start of the smaX line at that bar is below the bollinger line i'm refering to"
        Do you mean that you want to compare if the smaX crossed over smaY 2 bars ago, and if the smaX value from 2 bars ago is greater than the bollinger line Z? It may help to provide a screenshot showing these indicators and highlighting a part of the chart where the desired condition would be true, as well as pointing out what numeric values show that it is true.
        • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
        • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
        ​I appreciate your patience and look forward to your reply.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          thanks for the reply. i attached a screen grab of what i'm referring to. the crossover is just below the white dashed line. however, the sma line is below and above the line. i guess, i could reference the sma line further back so another bar ago. but sometimes i run into the same problem with the white solid line below that with the sma line.

          when looking back a bar ago at an sma line. spanning the width of the candle, is the end of the line at the candles edge the price of the sma line? or, is it the center of the candle and where the sma line is to that?
          Attached Files

          Comment


            #6
            Hello SteveReiza,

            Thank you for your reply.

            Please add prints to the Strategy Builder to understand what values are being used.

            "when looking back a bar ago at an sma line. spanning the width of the candle, is the end of the line at the candles edge the price of the sma line? or, is it the center of the candle and where the sma line is to that?"
            I do not understand what you are referring to; what is the result if you print the value of the SMA and compare that price to what you are seeing visually? Or you could use the data box and compare the values shown on the chart with the lines and candle values you are looking at. What do you currently have set up in your condition? Please provide a screenshot of the condition in the Strategy Builder that you are working with. Based on your descriptions, it sounds like you need to check if the cross above/cross below happens as well as if both SMA values are above the Bollinger line in order to meet your needs.

            I look forward to your reply.
            Emily C.NinjaTrader Customer Service

            Comment


              #7
              thanks for the reply. yes that makes sense. i do need to check and see if the crossabove and the sma line is above the bollinger line.

              i have the strategy updating on price change. but, the indicators are on bar close. does that make the first bar from the intrabar where the indicators are a [0] for the indicator - but, a [1] for the price action?

              Comment


                #8
                Hello SteveReiza,

                Thank you for your reply.

                If the indicators are being used in the strategy's logic, they will follow the Calculate property used by the strategy since it is the parent/host script and the indicators would be the children/hosted scripts. This means that if the strategy is updating On Price Change, any indicators used in the strategy logic will also update On Price Change. They would use the same barsAgo indexes to reference values from the same bars, whether it is the price series or indicator plot series.

                This is noted in the help guide page for Calculate:
                • https://ninjatrader.com/support/help.../calculate.htm
                  • "3. Embedded scripts within a calling parent script should not use a different Calculate property since it is already utilizing the Calculate property of the parent script (i.e. the strategy your indicator is called from).
                    4. Since the parent NinjaScript therefore governs this setting, it should be set to the highest needed setting satisfying all its childs.​"
                Please let me know if I may be of further assistance.
                Emily C.NinjaTrader Customer Service

                Comment


                  #9
                  thanks for the reply. okay, sweet. great to know. appreciate the guidance!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Jonker, Today, 01:19 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jonker
                  by Jonker
                   
                  Started by futtrader, Today, 01:16 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post futtrader  
                  Started by Segwin, 05-07-2018, 02:15 PM
                  14 responses
                  1,790 views
                  0 likes
                  Last Post aligator  
                  Started by Jimmyk, 01-26-2018, 05:19 AM
                  6 responses
                  838 views
                  0 likes
                  Last Post emuns
                  by emuns
                   
                  Started by jxs_xrj, 01-12-2020, 09:49 AM
                  6 responses
                  3,294 views
                  1 like
                  Last Post jgualdronc  
                  Working...
                  X