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 love2code2trade, 04-17-2024, 01:45 PM
              4 responses
              37 views
              0 likes
              Last Post love2code2trade  
              Started by alifarahani, Today, 09:40 AM
              2 responses
              13 views
              0 likes
              Last Post alifarahani  
              Started by junkone, Today, 11:37 AM
              3 responses
              20 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by frankthearm, Yesterday, 09:08 AM
              12 responses
              44 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Working...
              X