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()

    Hmm I have code that will paint the background color and draw a dot according to certain conditions. A problem I am encountering is that it will paint all the backgrounds correctly except sometimes it just doesn't want to draw the dot.

    Anyone else experiencing this?

    Code:
    if(Low[1]==Support[1] && Close[1]>Low[1])
    {
        longcount++;
        DrawDot(longcount.ToString(),0,Support[1],Color.Purple);
        BackColorAll = Color.PaleGreen;
    }
    if(High[1]==Resistance[1] && Close[1]<High[1])
    {
        shortcount++;
        DrawDot(shortcount.ToString(),0,Resistance[1],Color.Crimson);
        BackColorAll = Color.Pink;
    }
    You can see what I mean at 10:55 in the picture.
    Attached Files
    Josh P.NinjaTrader Customer Service

    #2
    Doh! I figured it out. Silly me. I was using two counters that started from 0 and were both incrementing by one. I so happened to just name my dots based on those counter values only so some dots where being redrawn else where hence them "missing" on some bars.

    Much better now.
    Code:
    if(Low[1]==Support[1] && Close[1]>Low[1])
    {
        longcount++;
        DrawDot(longcount.ToString(),0,Support[1],Color.Purple);
        BackColorAll = Color.PaleGreen;
    }
    if(High[1]==Resistance[1] && Close[1]<High[1])
    {
        shortcount[B]--[/B];
        DrawDot(shortcount.ToString(),0,Resistance[1],Color.Crimson);
        BackColorAll = Color.Pink;
    }
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Is there a way to choose which plot the DrawDot() will draw in? At the moment when I have an indicator in plot2 all of my DrawDot()s show up in plot1.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Sorry, what do you mean by plot1/2? Panel 1/2?

        Comment


          #5
          Yeah. Panel. My bad on the terminology. DrawDot() seems to only want to go into Panel 1 (the price panel) even if my indicator is in Panel 2.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Please check out the DrawOnPricePanel property: http://www.ninjatrader-support.com/H...ceOnPanel.html

            Comment


              #7
              oo. Great. Thank you Dierk.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Hi just though I'd quickly jump in,
                I'm setting
                DrawOnPricePanel = false;
                in the in the initialize but there's a compilation error saying DrawOnPricePanel does not exist in context.
                Am I missing an include or some sort of declaration for this?

                Cheers
                Tim

                Comment


                  #9
                  Only supported for indicators but not strategies.

                  Comment


                    #10
                    Ah right, thanks for that.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by swestendorf, Today, 11:14 AM
                    2 responses
                    5 views
                    0 likes
                    Last Post NinjaTrader_Kimberly  
                    Started by xiinteractive, 04-09-2024, 08:08 AM
                    4 responses
                    12 views
                    0 likes
                    Last Post xiinteractive  
                    Started by Mupulen, Today, 11:26 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post Mupulen
                    by Mupulen
                     
                    Started by Sparkyboy, Today, 10:57 AM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by TheMarlin801, 10-13-2020, 01:40 AM
                    21 responses
                    3,917 views
                    0 likes
                    Last Post Bidder
                    by Bidder
                     
                    Working...
                    X