Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with Parabolic SAR

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

    Problem with Parabolic SAR

    Hi guys,
    I am trying to build an automated trading strategy using parabolic SAR. But there seems to be some problem in calculating the SAR value. I am attaching screenshots of the error where I witness a change in the SAR direction but trend change condition has not met. For example, from the image, you will see the upward trend signal should happen only when the high of the current bar exceeds the SAR value of the previous bar. However, what I see right now is that high has not exceeded the previous SAR value and trend has changed. This becomes a problem if I try to compare the current bar high with previous bar SAR value for exiting my trade.

    Please, I would really appreciate if Ninja could look into this. Because, according to Esignal screenshot, the value of SAR of the previous bar is much lower than Ninja's value.

    Note: In both screenshots, I have circled the candle in question. You could see that in Ninja image, SAR changes direction even though the high of the candle is not higher than the SAR value on the previous candle. According to Ninja, previous SAR value is 53.84 and current bar high is 53.78. In eSignal, the previous SAR value is 53.778 and current bar high is 53.78.


    Thanks and Regards,
    Vipin
    Attached Files

    #2
    Hi Vipin,

    Thank you for posting.

    I'm happy to look into this.

    So I can compare this on our end -

    What kind of chart you loading? Instrument and time interval?

    What are the Indicator parameters that you are setting for the SAR?

    Are you using eSignals data for the NinjaTrader charts?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi,
      Thanks for getting back.
      I am using 3 minutes chart on TNA and the bar in question is for 8/19/2013 13:48 on Ninja. Parabolic SAR uses the default settings of 0.02, 0.02 and 0.2. Yes, I am using eSignal data feed for rendering charts in Ninja.

      Thanks and Regards,
      Vipin

      Comment


        #4
        Hi Vipin,

        I have tested this out on my end and see the same results.

        However, this indicator follows the rules of the FM Labs description that we follow -
        http://www.fmlabs.com/reference/default.htm

        After reviewing the code and the description, I can firmly say that this is not a coding bug but rather a difference in interpretation in how this is coded.

        You are more than welcome to go in and change the code to the expectations that you would expect.
        Tools -> Edit NinjaScript -> Indicator -> Parabolic SAR
        Right click in the editor and select Save As...
        Give the file a new name

        Let me know if I can be of further assistance.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Ok I will have to look into this. I just dont understand why the values were different but again thats what happens when you try to port your strategies from one platform to another. In addition to this, I have hit upon another snag. I am trying to place orders using DAS API. So, I have the daslibrary.dll with me and have added it to my references using the strategy script editor and also copied it to the Custom folder as per the instructions given by Ninja help index. But after reloading my ninja script, I seem to be getting this error "unable to load the assembly daslibrary.dll version 1.0.0.0.....".

          Any idea why is this happening?

          Thanks and regards,
          Vipin

          Comment


            #6
            Vipin,

            What version of the .NET framework was this compiled with?

            Did you add a reference in the NinjaScript editor, right click and select References..., for the daslibrary?
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              I think it was 4.0 and yes I added the reference through the ninja script editor.

              Comment


                #8
                Vipin,

                NinjaTrader 7 only support .NET 3.5 or below. You will need to get a version of the .dll that was compiled in 3.5 and that should work.
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  Ok let me check that...at least this dll connectivity should work otherwise this entire reason for porting the algo to Ninjatrader will be fruitless.

                  I will be back in a moment.....

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by ChartTourist, 04-27-2024, 08:22 AM
                  4 responses
                  55 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by r68cervera, Today, 04:45 AM
                  1 response
                  10 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by AveryFlynn, 04-25-2024, 04:57 AM
                  2 responses
                  17 views
                  0 likes
                  Last Post RogerHall  
                  Started by NJA_MC, 01-03-2021, 10:34 PM
                  12 responses
                  158 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by ageeholdings, Today, 05:22 AM
                  1 response
                  13 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Working...
                  X