Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how do i draw a dot ..... ?

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

    how do i draw a dot ..... ?

    what is the best way to draw dots from a strategy, which will then appear at the top or bottom of each strategy analyzer chart bar?

    #2
    Something like this would work well, notice that if I want the same call to DrawDot to not override the previous dot I need to create a unique tag

    DrawDot("tag1"+CurrentBar, true, 0, Low[0] - TickSize, Color.Red);

    DrawDot("tag2"+CurrentBar, true, 0, High[0] + TickSize, Color.Red);



    Please be aware, sometimes when plotting historical values from multi series scripts or from OnExecution() the dot values will appear shifted
    LanceNinjaTrader Customer Service

    Comment


      #3
      the following drawdot gives confusing results. could it be because the time field is missing?
      DrawDot("tag1"+CurrentBar, true, 0, Low[0] - TickSize, Color.Red);

      DRAWDOT Parameters
      tag
      A user defined unique id used to reference the draw object. For example, if you pass in a value of "myTag", each time this tag is used, the same draw object is modified. If unique tags are used each time, a new draw object will be created each time.
      autoScale
      Determines if the draw object will be included in the y-axis scale
      barsAgo
      The bar the object will be drawn at. A value of 10 would be 10 bars ago.
      time
      The time the object will be drawn at.
      y
      The y value
      color
      The draw object color (reference)

      Comment


        #4
        before I submitted the preceding thread the parameter listing was in a nice table. the table arrangement then disappeared. sorry 'bout that.

        Comment


          #5
          The time field is optional and you can use a bars ago value instead (which I did)

          DrawDot() has two overloads, one takes a date time and the other uses a bars ago value.

          A value of 0 would draw it on the bar when the condition triggers (sometimes you may need to shift this to the left or right if you're using a multi series script or calling it from OnExecution() )
          LanceNinjaTrader Customer Service

          Comment


            #6
            results of the following drawdots are displayed in the attachment. dots are not at bar tops and bottoms? please tell me what to do. this is for the multi time frame custom programming you did for me.

            DrawDot(
            "tag1"+CurrentBar, true, 0, Low[0] - 100*TickSize, Color.Black);
            DrawDot(
            "tag2"+CurrentBar, true, 0, High[0] + 100*TickSize, Color.Black);
            Attached Files

            Comment


              #7
              With multi time frame scripts it can be difficult to make the dots line up with the series. If it's the same script as before, you're likely placing the dots from the secondary series and plotting them on the primary.

              Try using

              DrawDot("tag1"+CurrentBars[0], true, -1, Lows[0][0] - 100*TickSize, Color.Black);

              to shift the values generated from the smaller time frame.
              LanceNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              637 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              366 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              107 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              569 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              572 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X