Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw tiny triangles like in Strategy Analyzer Chart view

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

    Draw tiny triangles like in Strategy Analyzer Chart view

    Hi, trying to create an indicator view that includes the little horizontal triangles as shown at the start/end of a trade in Strategy Analyzer Chart view...

    None of the standard Draw tools work... at a pinch I can create a triangle manually, but I cannot replicate the dynamic behaviour without resorting to fairly horrible logic in OnRender to resize it if/when the chart x/y scales are changed, that seems just way too hard. Tried various forms of text with graphic characters from eg Wingdings... which does the dynamics on scaling right, but the special characters (solid arrows) just don't render. Maybe fancy font families are the problem?

    Is there a simpler way?

    Cheers,
    T.

    #2
    Hello tgn55,

    Thank you for your post.

    The simplest way to place left or right arrows on the chart would be to add a plot using AddPlot() and set the Plotstyle parameter to PlotStyle.TriangleLeft or PlotStyle.TriangleRight.

    Alternatively, you could use Draw.Text() along with a symbol font to place left or right arrows on the chart.

    See the help guide documentation below for more information.
    AddPlot() - https://ninjatrader.com/support/help...t8/addplot.htm
    Draw.Text() - https://ninjatrader.com/support/help.../draw_text.htm

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thanks

      On revisiting this... I got Draw.Text working... and this option gives me the behaviour I want so, I think it is solved.
      FWIW... I think I had the Font Family set incorrectly yesterday.

      AddPlot is really going down the wrong path for my purposes
      Last edited by tgn55; 05-22-2021, 08:28 AM.

      Comment


        #4
        Hello tgn55,

        Thank you for your note.

        I am happy to hear you got Draw.Text() working.

        Please see the attached example script which demonstrates using Draw.Text() to draw a left arrow and right arrow on a chart. Note that Unicode characters are used for the left and right arrows that are drawn on the chart.

        Let us know if we may assist further.
        Attached Files
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Thanks. I used the more detailed signature...with a custom font etc, which gave me a bit more control over placement.

          Code:
          Draw[COLOR=#b4b4b4].[/COLOR]Text([COLOR=#569cd6]this[/COLOR], [COLOR=#d69d85]"ZEL"[/COLOR] [COLOR=#b4b4b4]+[/COLOR] tradebar, [COLOR=#569cd6]true[/COLOR], [COLOR=#d69d85]"▶ "[/COLOR], [COLOR=#b4b4b4]-[/COLOR][COLOR=#b5cea8]1[/COLOR], trade_price, [COLOR=#b5cea8]0[/COLOR], Brushes[COLOR=#b4b4b4].[/COLOR]DodgerBlue, triangleFont,
              TextAlignment[COLOR=#b4b4b4].[/COLOR]Right, Brushes[COLOR=#b4b4b4].[/COLOR]Transparent, Brushes[COLOR=#b4b4b4].[/COLOR]Transparent, [COLOR=#b5cea8]0[/COLOR]);
          All good...
          Cheers,
          T.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 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
          553 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