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

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,
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        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 pechtri, 06-22-2023, 02:31 AM
              10 responses
              124 views
              0 likes
              Last Post Leeroy_Jenkins  
              Started by judysamnt7, 03-13-2023, 09:11 AM
              4 responses
              59 views
              0 likes
              Last Post DynamicTest  
              Started by ScottWalsh, Yesterday, 06:52 PM
              4 responses
              36 views
              0 likes
              Last Post ScottWalsh  
              Started by olisav57, Yesterday, 07:39 PM
              0 responses
              7 views
              0 likes
              Last Post olisav57  
              Started by trilliantrader, Yesterday, 03:01 PM
              2 responses
              22 views
              0 likes
              Last Post helpwanted  
              Working...
              X