Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Use Plot to draw triangles

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

    Use Plot to draw triangles

    Hi,
    I thought I was doing something simple but have not been able to get this to work. All I want is to plot a triangle when there is an EMA cross. I don't want to use the "DrawTriangleUp" because I want to adjust the size, etc of the triangles. Attached is a snippet of what I have in my code....


    As always, thanks for your great help!
    Attached Files

    #2
    Hello,

    Thank you for the question.

    I looked at the code provided and see that you currently have everything where it should be if you were trying to plot a triangle when the cross happens. The triangle unfortunately can not have its size changed so it would remain the size it is drawn at.

    Currently in NinjaTrader there is no way to define a size for the drawing objects such as the triangle.

    Please let me know if I may be of additional assistance,

    Comment


      #3
      ok, I guess I'm confused now. So what is the difference between "DrawTriangleUp" and "PlotStyle.TriangleUp"? In my code, using "PlotStyle.TriangleUp", I don't get any errors but it doesn't draw any triangles either. No errors in the output window either.

      Comment


        #4
        Hello,

        The plot style is the type of line, you can have a Solid line or one of the options is TriangleUp for example. If you apply an indicator like the SMA, you can try all of the different plot styles by adjusting its properties in the chart to see how each look.

        I had actually missed that you were using this as the line style, but your use of DrawTriangleUp in your if statement is what I was referring to as to being correct. Either way the triangle size can not be changed in this case.

        The TriangleUp plot style will produce a line of triangles instead of a straight line, it basically just looks like dots that form a line.

        I look forward to being of further assistance.

        Comment


          #5
          Ah, ok... makes sense.

          Thanks

          Comment


            #6
            Originally posted by mlarocco View Post
            Hi,
            I thought I was doing something simple but have not been able to get this to work. All I want is to plot a triangle when there is an EMA cross. I don't want to use the "DrawTriangleUp" because I want to adjust the size, etc of the triangles. Attached is a snippet of what I have in my code....


            As always, thanks for your great help!
            If you want a size-specifiable triangle, use a text triangle with DrawText(). You can resize text to whatever you want.

            Comment


              #7
              Thanks for the replies. I actually figured out how to do it using WingDings. Works very nice.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              578 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X