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

Trying to use Draw.Triangle Below and above bar not working

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

    Trying to use Draw.Triangle Below and above bar not working

    Hello,
    Im trying to use Draw.TriangleUp Below EVERY bar and
    Im trying to use Draw.TriangleDown Above EVERY bar,

    when i use one snippet: Draw.TriangleDown(this, "MyTriDown"+CurrentBar.ToString(), true, 0, High[0] + (TickSize * 125), Brushes.Red);
    It plots every bar; however, when i add in the other object:
    Draw.TriangleUp(this, "MyTriUp"+CurrentBar.ToString(), true, 0, Low[0] - (TickSize * 25), Brushes.Red);
    BLAH... PLZ HELP and Thank you in advance
    Sincerely,
    Mikeyboy

    #2
    Hello, thanks for writing in. This does not look like a complete snippet of code. I am not seeing any conditions separating the triangle colors from up bars and down bars. Do you have these in your script?
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      I just want to plot both triangles on top and bottom of every bar, is this possible, so the bar is surrounded by triangles
      Draw.TriangleUp(this, "MyTriUp"+CurrentBar.ToString(), true, 0, Low[0] - (TickSize * 25), Brushes.Red);
      Draw.TriangleDown(this, "MyTriDown"+CurrentBar.ToString(), true, 0, High[0] + (TickSize * 25
      this is my only code in onbarupdate()
      Thanks again ​

      Comment


        #4
        Hello, thanks for the follow up. What is the specific error you are getting or non-expected behavior? It looks like these should work.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          right?
          When i use both lines of code i only get one print on one bar for one. when i use b
          one line up or down u get a triangle every bar but for some reason wrong let me do two every bar even with magical Tag number.
          i would love to know why so i can understand the language better rather than functionality in this specific case

          thanks

          Comment


            #6
            Hi, thanks for the follow up. I am able to do it with this code in OnBarUpdate. Can you please try this?
            Code:
                    protected override void OnBarUpdate()
                    {
                        Draw.ArrowDown(this, "down"+CurrentBar, false, 0, High[0]+TickSize*4, Brushes.Red);
                        Draw.ArrowUp(this, "up"+CurrentBar, false, 0, Low[0]-TickSize*4, Brushes.Lime);
                    }​
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Wow bro this is bizzare, it totally works, I changed it to
              Draw.Text(this, "down"+CurrentBar, "H", 0, High[0]+TickSize*4, Brushes.Red);
              Draw.Text(this, "up"+CurrentBar, "L", 0, Low[0]-TickSize*4, Brushes.Lime);​
              And this works too, very interesting, i might have missed a field or had some other stuff in script,
              Anyways glad to see we can basically infinitley plot labels,that was a big reason for me switching to ninja from trading view, you can only draw 500 lines and 500 boxes in pinescript
              Slap on a bars back filter to clear up that lag and the possibilities are endles
              Cheers!,
              Michael

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ChrisR, Yesterday, 09:24 PM
              3 responses
              15 views
              0 likes
              Last Post ChrisR
              by ChrisR
               
              Started by balltrader, Today, 10:06 AM
              6 responses
              28 views
              1 like
              Last Post QuantKey_Bruce  
              Started by Attila, 03-07-2023, 09:47 AM
              4 responses
              31 views
              0 likes
              Last Post BartMan
              by BartMan
               
              Started by BartMan, Today, 03:59 PM
              0 responses
              12 views
              0 likes
              Last Post BartMan
              by BartMan
               
              Started by QuantKey_Bruce, 03-29-2023, 02:31 PM
              10 responses
              43 views
              0 likes
              Last Post BartMan
              by BartMan
               
              Working...
              X