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

alerts

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

    #16
    Originally posted by NinjaTrader_Bertrand View Post
    Try work only on one condition until you're confident this is what you're after, for example you have a lookback setting of 2 in all your condition, thus some double dots following each other would be expected, if I comment out all but the first condition you've setup and change the lookback for the CrossAbove to 1 it works as expected -

    Code:
     
    if (CrossAbove(DiPlus, 20, 1))//1 is width of dot?
    //DrawDot("di+20 up" + CurrentBar, false, 0, Low[0], Color.White);
    DrawDot("di+20 up" + CurrentBar, false, 0, Low[0]- (TickSize*dist), Color.Lime);
    Thanks, I thought changing the 1 to the 2 made the dots larger--you mean I created a lookback.

    Comment


      #17
      Correct, you want to enter 1 here in your case, it does not change the dot width as you suspected, the dots have a default size.
      BertrandNinjaTrader Customer Service

      Comment


        #18
        Originally posted by NinjaTrader_Bertrand View Post
        Correct, you want to enter 1 here in your case, it does not change the dot width as you suspected, the dots have a default size.
        thanks its fixed.

        Comment


          #19
          Originally posted by NinjaTrader_Bertrand View Post
          Correct, you want to enter 1 here in your case, it does not change the dot width as you suspected, the dots have a default size.

          So using the 1 in the statement should be exactly the same result as inserting && DiPlus[1] <= 20)

          Correct?

          Comment


            #20
            Did you ever figure out why Overlay=false; didnt put the dots on the indicator panel instead of on the candle panel?

            Comment


              #21
              No, the outcomes would still be different, in your case juse use the Cross over with a lookback of 1 - you want to work with DrawOnPricePanel for this, not with the overlay one - http://www.ninjatrader-support.com/H...ceOnPanel.html
              BertrandNinjaTrader Customer Service

              Comment


                #22
                Originally posted by NinjaTrader_Bertrand View Post
                No, the outcomes would still be different, in your case juse use the Cross over with a lookback of 1 - you want to work with DrawOnPricePanel for this, not with the overlay one - http://www.ninjatrader-support.com/H...ceOnPanel.html
                i tried adding DrawOnPricePanel=false; in the initialize section but it didnt work.
                Should I maybe add it after each DrawDot statement or maybe after the fourth DrawDot statement or somewhere else?

                Comment


                  #23
                  If you want to plot on the indicator panel with this scripts, you would then also need to adapt your Y values used in the DrawDot calls, right now you plot them at the highs and lows of the price panel, this will need a change to the DiPlus / Minus indicator values.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #24
                    Originally posted by NinjaTrader_Bertrand View Post
                    If you want to plot on the indicator panel with this scripts, you would then also need to adapt your Y values used in the DrawDot calls, right now you plot them at the highs and lows of the price panel, this will need a change to the DiPlus / Minus indicator values.
                    Like this?

                    Code:
                                   if (CrossAbove(DiPlus, 20, 1))        DrawDot("di+20 up" + CurrentBar, false, 0, [COLOR=red]DiPlus[0]-(TickSize*dist)[/COLOR], Color.Lime);                  if (CrossAbove(DiMinus, 20,1))        DrawDot("di-20 up" + CurrentBar, false, 0, [COLOR=red]DiMinus[0]-(TickSize*dist)[/COLOR], Color.Red);                  if (CrossAbove(DiPlus, 25,1 ))        DrawDot("di+25up" + CurrentBar, false, 0, [COLOR=red]DiPlus[0]-(TickSize*dist)[/COLOR],Color.Lime);                    if (CrossAbove(DiMinus, 25,1 ))        DrawDot("di-25 up" + CurrentBar, false, 0, [COLOR=red]DiMinus[0]-(TickSize*dist)[/COLOR],Color.Red);
                    Last edited by simpletrades; 10-26-2009, 11:17 AM.

                    Comment


                      #25
                      Yes, like this - but you would need to adjust your tick size multiplier of course, too.
                      BertrandNinjaTrader Customer Service

                      Comment


                        #26
                        Originally posted by NinjaTrader_Bertrand View Post
                        Yes, like this - but you would need to adjust your tick size multiplier of course, too.
                        Thanks it works fine now.
                        One more related question from the same indicator...

                        Add(new Plot(new Pen(Color.Transparent, 1), "ADX"));
                        Add(new Plot(Color.Green, "+DI"));
                        Add(new Plot(Color.Red, "-DI"));

                        Does the 1 in the ADX statement refer to 1 bar ago?
                        If I wanted the 2 DMI's to be a width of 2 without having to fix it on my chart indicator pulldown that way, is it just adding the number in somewhere or is it a whole new statement?

                        Comment


                          #27
                          No, the 1 is the width of the Pen Plot, this is just for visualization, it's not referring to actual ADX indicator values.

                          You can set the Plot width directly in the Initialize(), for example your Plus and Minus values are associated with Plot0 and Plot1 -

                          Code:
                           
                          Plots[0].Pen.Width = 2;
                          Plots[1].Pen.Width = 2;
                          This will set them to a default width of 2.
                          BertrandNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by The_Sec, Today, 02:29 PM
                          1 response
                          5 views
                          0 likes
                          Last Post NinjaTrader_Jesse  
                          Started by jeronymite, 04-12-2024, 04:26 PM
                          2 responses
                          30 views
                          0 likes
                          Last Post NinjaTrader_BrandonH  
                          Started by Mindset, 05-06-2023, 09:03 PM
                          10 responses
                          265 views
                          0 likes
                          Last Post NinjaTrader_BrandonH  
                          Started by michi08, 10-05-2018, 09:31 AM
                          5 responses
                          743 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by tsantospinto, 04-12-2024, 07:04 PM
                          4 responses
                          63 views
                          0 likes
                          Last Post aligator  
                          Working...
                          X