Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawDot

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

    DrawDot

    Hi,

    I have a DrawDot working nicely with the following line.

    Code:
    DrawDot("dotdown" + CurrentBar, true, 0, High[0] + 5 * TickSize, Color.Red);
    Two questions:

    1) If I wanted the dot to plot at the exact price the signal was generated, would I simply remove the "High[0] + 5"?

    Maybe as follows....

    Code:
    DrawDot("dotdown" + CurrentBar, true, 0, + 0 * TickSize, Color.Red);
    I thought maybe there was something like "LastPrice[0] + 5", but can´t find in the wizard.



    2) This plots the dot 5 ticks above the high. But, then if the high changes, the dot stays in the same place and is sometimes obscured by the candle, if the candle moves up 5 ticks or more after the dot is originally plotted.

    So, how to make the dot move with the high of the bar, if the high of bar moves up?

    #2
    Hello ScottieDog,

    Thanks for writing in.

    If you want to draw the dot based on the last price of the bar you would use the following.
    DrawDot("dotdown" + CurrentBar, true, 0, Close[0], Color.Red);

    So I may assist you further however, to see why your initial settings result in the dot getting drawn before the high of the bar is complete (resulting in bars overlapping the dot at time), please answer the following.

    Who are you connected to? This is indicated in green at the bottom left of the Control Center.
    For the NinjaScript, what setting are you using for Calculate On Bar Close?
    What condition are you using to draw the dot?

    I look forward to assisting you further.

    Comment


      #3
      Originally posted by NinjaTrader_Brandon View Post
      Hello ScottieDog,

      Thanks for writing in.

      If you want to draw the dot based on the last price of the bar you would use the following.
      DrawDot("dotdown" + CurrentBar, true, 0, Close[0], Color.Red);

      I see, so the Close will be last price, if intrabar?

      I don´t want to wait until close of bar, I want it updating intrabar (COBC is set to FALSE).

      Comment


        #4
        Originally posted by NinjaTrader_Brandon View Post
        Hello ScottieDog,


        So I may assist you further however, to see why your initial settings result in the dot getting drawn before the high of the bar is complete (resulting in bars overlapping the dot at time), please answer the following.

        Who are you connected to? This is indicated in green at the bottom left of the Control Center.
        For the NinjaScript, what setting are you using for Calculate On Bar Close?
        What condition are you using to draw the dot?
        CQG.

        I want it updating intrabar. COBC is set to FALSE.

        Will have to get back to you on the condition, don´t recall and not at that computer.

        Is there a way to make the dot move with the candle though, after its plotted? If plotting intrabar.

        Comment


          #5
          Hello ScottieDog,

          Thanks for your reply.

          I would need to review the code that is being used to draw the dot and it may not be getting called again.
          Once you are able to provide this information I will look into this further.
          Also please let me know if you are still managing the code with the Strategy Wizard or if you have unlocked the code.

          Comment


            #6
            Here is the condition


            Code:
            if ( 
            				   (Low[0] < Low[1]) 
            				&& (Low[0] < Low[2])
            				
            				
            				&& (GVL.Delta[0] > 30)
            				&& (gcdUDTick.DeltaValue[0] > 30)
            				
            				)
            			{
            				Alert(tag2, Priority.High, tag2, @"C:\Program Files\NinjaTrader 7\sounds\click3.wav", 1, Color.Green, Color.White);
                			
            				DrawDot("dotup" + CurrentBar, true, 0, Close[0] - 0 * TickSize, Color.Green);
            				Alert2=true;

            Btw. The code is unlocked (reluctantly - lol)
            Last edited by ScottieDog; 11-01-2013, 02:03 AM.

            Comment


              #7
              ScottieDog, yes Close[0] on COBC false would be the last tick that called OnBarUpdate(). The drawing would not move unless the condition is called again to do so and an updated price is provided as y value, so if you saw the condition called again yet the last tick price would be equal to the one that previously triggered, then you would not visually see a change. With further custom programming though the initial high price for example could be saved where a dot is drawn at and then as that value intrabar would be breached the dot redrawn.

              Comment


                #8
                OK. Understood.

                Thanks.

                Originally posted by NinjaTrader_Bertrand View Post
                ScottieDog, yes Close[0] on COBC false would be the last tick that called OnBarUpdate(). The drawing would not move unless the condition is called again to do so and an updated price is provided as y value, so if you saw the condition called again yet the last tick price would be equal to the one that previously triggered, then you would not visually see a change. With further custom programming though the initial high price for example could be saved where a dot is drawn at and then as that value intrabar would be breached the dot redrawn.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                599 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                344 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                103 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                558 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                557 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X