Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Conditional plot

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

    Conditional plot

    Please help understand how to plot a "dot" on the chart for the following condition.

    If Low[0] < Typicals [0]

    then plot

    dot = ( Typicals [0] * 2 ) - Low [0];

    DOT.Set(dot);

    having difficulty with the logic to plot.

    Thank you.

    TX

    #2
    Hello tradethebonds,

    Thanks for your post.

    To draw a single dot you can use DrawDot().

    Is the "( Typicals [0] * 2 ) - Low [0]" to be the price level where the dot is drawn?

    If so, you can do the following:

    if (Low[0] < Typical[0])
    {
    DrawDot("tag1"+CurrentBar, true, 0, ( Typical[0] * 2 ) - Low [0], Color.Blue);
    }

    Below is a link to the help guide on DrawDot().
    http://www.ninjatrader.com/support/h...t7/drawdot.htm

    And a link to the Typical (not Typicals which would be for multiple data series).
    http://www.ninjatrader.com/support/h...t7/typical.htm

    Let me know if I did not understand this correctly.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you, works perfect.

      Sorry, how can I reduce the size of the dot?

      TX

      Comment


        #4
        Hi tradethebonds,

        Its not possible to change the size of the dot using DrawDot.

        There has been requests to add this feature of changing the dot size and this is on the list of considerations for future versions.

        In the meantime, an alternative would be using DrawText with a Windows character that looks like a dot.

        For example:
        dotFont = new Font("Symbol", 38);

        DrawText("myDot"+CurrentBar, true, "·", 0, ( Typical[0] * 2 ) - Low [0], 0, Color.Blue, dotFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 10);

        DrawText(string tag, bool autoScale, string text, int barsAgo, double y, int yPixelOffset, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color areaColor, int areaOpacity)

        http://www.ninjatrader.com/support/h...7/drawtext.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          How do I declare this variable dotFont please? (i.e. int or double doesn't work)

          For example:
          dotFont = new Font("Symbol", 38);

          Thx,

          TX

          Comment


            #6
            Hello,

            That should be declared as a Font.

            private Font dotFont = new Font("Symbol", 38);
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I appreciate your help & patience very much!!!!!!!!!!!!!!!!!!!!

              Works better than expected.

              Have a wonderful Holiday Season or Merry Christmas if you will!!

              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