Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaPriceAction

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

    #31
    Am going to try this one out,

    Thanks,

    Johan

    Comment


      #32
      privatedouble LastHH;
      privatedouble LastLL;
      Ok, like you see those already done, now where do I have to set these?

      if this bar is HH then: LastHH = High[0];
      if this bar is LL then: LastLL = Low[0];


      Thanks again,

      Johan (see below what I tried but not worked)

      ifthis bar is HH then: LastHH = High[0];
      ifthis bar is LH then:

      DrawDot(
      "LH" + CurrentBar, false, 0, LastHH, Color.Red);


      else
      ifthis bar is LL then: LastLL = Low[0];
      ifthis bar is HL then:

      DrawDot(
      "HL" + CurrentBar, false, 0, LastLL, Color.Red);

      Last edited by jojotrader; 01-12-2009, 07:26 AM.

      Comment


        #33
        jojotrader,

        That is not C# code. That was just code in English. You would need to use proper C# code to make it work.
        Josh P.NinjaTrader Customer Service

        Comment


          #34
          Originally posted by NinjaTrader_Josh View Post
          That was just code in English. You would need to use proper C# code to make it work.
          I just forgot to highlight that, thanks Josh.

          Johan, I expressed the if-conditions as text phrases because I don't know how these conditions are defined in your code. So, I wanted to describe under which conditions the 2 variables LastHH and LastLL are to be set and under which conditions DrawDot() is to be called. Only DrawDot() is a line of real code.

          Regards
          Ralph

          Comment


            #35
            If you please you maybe want to take a look at that NinjaPriceAction file...

            If not, ok, I know I asking things that takes a bit of time....

            Johan.


            Anyway, thanks again for the help.
            Attached Files

            Comment


              #36
              Hi Johan,

              here is my proposal (untested) just for HH. Have a look if that makes sense.

              Regards
              Ralph

              Code:
              [COLOR=red]private double LastHH;[/COLOR]
               
              if (curhigh < prevhigh + offset && curhigh > prevhigh - offset)
              {
                DrawText("DT"+CurrentBar,"DT",barsback, High[barsback] + toffset, Color.Gold);
              }
              else if (curhigh > prevhigh)
              {
                [COLOR=red]LastHH = High[barsback];[/COLOR]
                DrawText("HH"+CurrentBar,"HH",barsback, High[barsback] + toffset, Color.Green);
              }
              else
              {
                [COLOR=red]DrawDot("LH" + CurrentBar, false, barsBack, LastHH , Color.Red);[/COLOR]
                DrawText("LH"+CurrentBar,"LH",barsback, High[barsback] + toffset, Color.Red);
              }

              Comment


                #37
                Almost, error is Statement expected at red lights....

                barsback = Swing(strength).SwingHighBar(0,1,lookback);
                if (barsback == -1) return;
                curhigh = Swing(strength).SwingHigh[barsback];

                curATR = ATR(
                14)[barsback];
                offset = curATR * dtbstrength /
                100;
                toffset = curATR * textoffset /
                100;(here)


                privatedouble LastHH;

                if (curhigh < prevhigh + offset && curhigh > prevhigh - offset)
                DrawText(
                "DT"+CurrentBar,"DT",barsback, High[barsback] + toffset, Color.Gold);
                elseif (curhigh > prevhigh)
                LastHH = High[barsback];
                DrawText(
                "HH"+CurrentBar,"HH",barsback, High[barsback] + toffset, Color.Green);(and here)
                else
                DrawDot("LH" + CurrentBar, false, barsBack, LastHH , Color.Red);
                DrawText(
                "LH"+CurrentBar,"LH",barsback, High[barsback] + toffset, Color.Red);


                Thanks a lot for the help...

                Jojo

                Comment


                  #38
                  jojotrader,

                  Please provide the errors.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #39
                    Concerning the second red mark: If an if-statement contains more than 1 statement you need to put them into braces {}. Refer to my code example.

                    Regards
                    Ralph

                    Comment


                      #40
                      Looks like it going to work....
                      Only need variable DOT or bigger one...

                      Any ideas?


                      Thanks a lot again for the help.

                      Johan

                      Comment


                        #41
                        Hi Johan, not sure what you refer to - please post your code in question so we can have a look. Thanks!

                        Comment


                          #42
                          I was waiting for this question already Johan. You have two choices (at least):

                          1) Extend the Plot() method which enables you to apply all graphical functions C# provides for you. But that needs programming experiences.

                          2) Go back to the DrawText approach and use Font() with a symbol font like Windings. We had this discussion already please read the following link: http://www.ninjatrader-support2.com/...21&postcount=4

                          Regards
                          Ralph

                          Comment


                            #43
                            DrawText Writing Over Previous Text

                            Folks,
                            I have added DrawText statements to display the Price of Swing Points. The problem is that occasionally the Price apprears to write over a previous price (see picture). I have tried formatting "ToString(), RemoveDrawingObject, and countless other measures. The DrawText Tags are unique and compiles without errors.

                            Any guidance is greatly appreciated.

                            Here is the portion of code that I added to the original:


                            SwHiRng = curhigh;
                            SwLoRng = curlow;



                            if (curlow > prevlow - offset && curlow < prevlow + offset)
                            {
                            DrawText(
                            "DB"+CurrentBar,"DB",barsback, Low[barsback] - toffset, Color.Blue);
                            DrawText(
                            "SDB"+CurrentBar,SwLoRng.ToString("0.00"),barsback, Low[barsback] - (toffset-3*TickSize), Color.Blue);
                            }
                            else
                            if (curlow < prevlow)
                            {
                            DrawText(
                            "LL"+CurrentBar,"LL",barsback, Low[barsback] - toffset, Color.Red);
                            DrawText(
                            "SLL"+CurrentBar,SwLoRng.ToString("0.00"),barsback, Low[barsback] - (toffset-3*TickSize), Color.Red);
                            }
                            else
                            {
                            DrawText(
                            "HL"+CurrentBar,"HL",barsback, Low[barsback] - toffset, Color.Green);
                            DrawText(
                            "SHL"+CurrentBar,SwLoRng.ToString("0.00"),barsback, Low[barsback] - (toffset-3*TickSize), Color.Green);
                            }


                            }

                            Comment


                              #44
                              Sorry, Picture didn't attach.
                              Attached Files

                              Comment


                                #45
                                Nomar,

                                Very likely your barsBack parameter incremented to add it onto the same bar.
                                Josh P.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                602 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                347 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                103 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                560 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                559 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X