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

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 hazylizard, Today, 08:38 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by geddyisodin, Today, 05:20 AM
              2 responses
              16 views
              0 likes
              Last Post geddyisodin  
              Started by Max238, Today, 01:28 AM
              5 responses
              43 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by giulyko00, Yesterday, 12:03 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by habeebft, Today, 07:27 AM
              1 response
              16 views
              0 likes
              Last Post NinjaTrader_ChristopherS  
              Working...
              X