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

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.
    BrandonNinjaTrader Customer Service

    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.
          BrandonNinjaTrader Customer Service

          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.
              BertrandNinjaTrader Customer Service

              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 RookieTrader, Today, 09:37 AM
                2 responses
                10 views
                0 likes
                Last Post RookieTrader  
                Started by alifarahani, Today, 09:40 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by Gerik, Today, 09:40 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by KennyK, 05-29-2017, 02:02 AM
                3 responses
                1,285 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by AttiM, 02-14-2024, 05:20 PM
                11 responses
                186 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X