Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to plot DOTS in between 2 SMA?

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

    How to plot DOTS in between 2 SMA?

    Hi!

    I would like to plot a DOT to get the price in between 2 SMA lines.
    Eg.
    SMA(10): 11000
    SMA(20): 12000
    In between: 11500

    Any help on how to create an indicator to draw a DOT at 11500 in realtime?
    Thanks!

    Jim

    #2
    Jim,

    What you want to do is access the two SMA values and find the midpoint.

    Code:
    dotValue = (SMA(10)[0] + SMA(20)[0]) / 2;
    DrawDot("dot" + CurrentBar, true, 0, dotValue, Color.Red);
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      How to plot DOTS in between 2 SMA?

      And how can I adjust the size of the Dots? I am using the "DrawDot" formula and works fine but when it plots in the chart, and since I have it overlaying on the last Bars, it hides the OHLC Bars!

      The Dots seem to be designed to match the width of the Candle Stick Bars, so when I use the OHLC bars (which are narrower) the Dots look huge in comparisson and I can't see the Open or Close of such Bars.

      See the attached picture. Notice the Yellow, Pink and Orange Dots, which are hiding the OHLC Bars due to their size. However I am also using an Indicator (ATR Trailing), which uses a much smaller Dots. These last I could use but I can't change the size when I use the DrawDots formula.

      Thanks
      HJS
      Attached Files
      Last edited by HJSInvesting; 01-19-2009, 06:03 PM. Reason: Miising info in original Post

      Comment


        #4
        Hi HJS, unfortunately you cannot change the DrawDot size.

        You could try using DrawText with a symbol font and change the font size.

        Comment


          #5
          Thanks for the input.

          Here's my working code:

          double dotValue = (SMA(sma1)[0] + SMA(sma2)[0]) / 2;

          textFont = new Font("Webdings",markersize);
          DrawText("dot" + CurrentBar, "n", 0, dotValue, Color.White, textFont, StringAlignment.Center, Color.Black, Color.Black, 1);
          Remember to add "private System.Drawing.Font textFont;" in the Variables section.

          Enjoy!

          Jim

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          607 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          353 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          561 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X