Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ehlers Sine Wave

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

    #16
    Support Resistance lines

    I am running this on the Caca40 1 and 5 min charts. It is plotting the support and Resistance lines 1 point below the actual value???
    I looked at code and it does call for the High or Low of the last bar...so I can't figure out why it does not plot there.
    Anyone have any ideas?

    Comment


      #17
      I think this is as expected, since it's recording the price High / Low value when the sinewave indicator and trigger lines cross to plot this forward as a reference point.
      BertrandNinjaTrader Customer Service

      Comment


        #18
        I added print statements to the codeto see what vaues it was using. They agree with the values I get off the chart data box but not what is plotted???
        I compared the Drawtext statement o the one in the ElhersSineWave code and thy are the same....so it must have something to dowith the chart or ???

        Comment


          #19
          Originally posted by NinjaTrader_Bertrand View Post
          I think this is as expected, since it's recording the price High / Low value when the sinewave indicator and trigger lines cross to plot this forward as a reference point.
          It should not record the value when the two lines crossed but the value when the high/low of the previous bar was exceeded after we had a cross.
          I also noticed that the drawing is not exactly where it should be. I'll double check it when I can, I want to verify the value of yPixels is 0.

          Comment


            #20
            Thanks for checking yuvalw.
            BertrandNinjaTrader Customer Service

            Comment


              #21
              I added the print statements right after the calculation of the Dot values was done. That way I printing out the values that the indicator was using. I believe it is just the justification of the text???

              Comment


                #22
                Here is a screen shot of the dots plotted with a text of the value used in the DrawText method.
                For comparison I tried the DrawDot method which seems to work fine just with very big dots...

                Looks like Ninja is not printing the text in the exact location...
                Attached Files

                Comment


                  #23
                  I think that the problem is in where the "text is justifie. In other words is it centered vertically in the spce or is the bottom of the text touching the bottom of the space. That would create the effect you demonstrated in the two screen shots, the center of the larger dot is higher off the bottom of the space. I don't know if tere is a way to correct this. What about using the DrawLine method???

                  Comment


                    #24
                    You can play around with the String.Alignment setting, but I think the DrawDot works well from the screenshot you posted.

                    BertrandNinjaTrader Customer Service

                    Comment


                      #25
                      Originally posted by NinjaTrader_Bertrand View Post
                      You can play around with the String.Alignment setting, but I think the DrawDot works well from the screenshot you posted.

                      http://msdn.microsoft.com/en-us/libr...nt(vs.71).aspx
                      I don't understand what the String.Alignment has to do with this:
                      1) String.Alignment is horizontal alignment
                      2) The text is only a dot ".", there is not much room to play with it.

                      you should check wht you don't render the text in the given y value.

                      Comment


                        #26
                        yuvalw,

                        Draw the complete text box with colors to see where the text takes up space in rendering.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #27
                          I have looked at the link posted. I am new to C# but it looks like we could add a line to set the alignment

                          public StringAlignment Alignment {get; set;}

                          There seem to be 3 choices near, far and center.
                          I think that the center would align the dot in the
                          center both Horizontally as well as vertically.

                          I guess you would have to add this to the properties section.
                          How would you code in to the script,
                          there really is no reason the need to change it once set.

                          Comment


                            #28
                            You can use this directly with the second overload from this link - http://www.ninjatrader-support.com/H.../DrawText.html
                            BertrandNinjaTrader Customer Service

                            Comment


                              #29
                              After writing that post I thought that there probly was an override in the callout. Thanks for your post

                              Comment


                                #30
                                Originally posted by NinjaTrader_Josh View Post
                                yuvalw,

                                Draw the complete text box with colors to see where the text takes up space in rendering.
                                Here is a screenshot with using "outline" color to draw the text box. Still, it is not in the correct y value.
                                Attached Files

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by adeelshahzad, Today, 03:54 AM
                                5 responses
                                32 views
                                0 likes
                                Last Post NinjaTrader_BrandonH  
                                Started by stafe, 04-15-2024, 08:34 PM
                                7 responses
                                32 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by merzo, 06-25-2023, 02:19 AM
                                10 responses
                                823 views
                                1 like
                                Last Post NinjaTrader_ChristopherJ  
                                Started by frankthearm, Today, 09:08 AM
                                5 responses
                                19 views
                                0 likes
                                Last Post NinjaTrader_Clayton  
                                Started by jeronymite, 04-12-2024, 04:26 PM
                                3 responses
                                43 views
                                0 likes
                                Last Post jeronymite  
                                Working...
                                X