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

Looking for help on igh/low plots

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

    Looking for help on igh/low plots

    I need to get a plot to go on the low of a bar when it closes higher then previous bar and high of bar when it closes below the low of previous bar.

    Thanks for any help!

    #2
    Something like:

    double DesiredValue = (Close[2]> Close[1] Myplot = Low[2]

    Then

    = Close[2]<Close[1] Myplot High[2}

    Comment


      #3
      Hello reedstickets,

      Thanks for your post.

      Can you clarify what particular help you are looking for?

      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Thanks for the help PaulH.

        I use to code in NT7 yeas ago but am a bit lost now in NT8 and rusty.

        Mainly need help with how to program the actual plot. I have the Addplot "Myplot" set up, but not sure the command I need to use.

        Comment


          #5
          Hello reedstickets,

          Thanks for your post.

          I'm not sure but it looks like out posts got out of sequence!

          I would suggest using the Ninjascript wizard to create the indicator structure that you need. With the wizard you would supply any inputs needed as well as any plots. By default a plot is has a "Plotstyle" of line type however you can change the plot style to a number of other markers suchas dots, blocks, squares and triangles. The wizard will complete all of the structure for you so all you would need would be to add the OnBarUpDate() logic needed.

          An example of the code would be something like:

          if (Close[2] > Close[1])
          {
          myPlot[0] = Low[2];
          }

          Here is a link to the Ninjascript wizard: https://ninjatrader.com/support/help...?ns_wizard.htm

          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Hello reedstickets,

            just saw your new post of "Mainly need help with how to program the actual plot. I have the Addplot "Myplot" set up, but not sure the command I need to use."

            Suggest then this example:

            if (Close[2] > Close[1])
            {
            Myplot[0] = Low[2];
            }
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Thanks for the help,

              I got it plotting but my logic is messed up. Is there a way to have the plot:

              If (Close[1] > Close[0])

              But then a condition for if the close does not close higher then the previous bar [1] or close lower then the Low[1] to not plot a new plot until one of those two events occur?

              Thanks for any help, I really need this for my trading.

              Comment


                #8
                Hello reedstickets,

                Thanks for your reply.

                I'm a bit confused by what you are writing.Could you restate for clarity or provide a screenshot of the condition(s) you are looking for?

                In terms of syntax, in C# the double ampersand && means a logic "And". The double pips || would be the C# logic "Or".

                if (condition_A && (Condition_B || Condition_C))
                {
                // Do something
                }


                In the above the code would "Do something" only if A+ B is true, or if A + C is true.

                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Aviram Y, Today, 05:29 AM
                0 responses
                2 views
                0 likes
                Last Post Aviram Y  
                Started by quantismo, 04-17-2024, 05:13 PM
                3 responses
                27 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by ScottWalsh, 04-16-2024, 04:29 PM
                7 responses
                34 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by cls71, Today, 04:45 AM
                0 responses
                6 views
                0 likes
                Last Post cls71
                by cls71
                 
                Started by mjairg, 07-20-2023, 11:57 PM
                3 responses
                218 views
                1 like
                Last Post PaulMohn  
                Working...
                X