Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem Adding ParabolicSAR to MACD

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

    Problem Adding ParabolicSAR to MACD

    Hello,
    Adding a ParabolicSAR to the MACD as an indicator was no problem. It works perfectly (see sample), but when I try to code it in Ninjascript, I see in the output window it's using price data instead of the MACD data. The Ninjascript setup is as follows:
    MACD2 = MACD(Close, 12, 26, 9);
    ParabolicSAR2 = ParabolicSAR(MACD2.Default, 0.02, 0.2, 0.02);

    Is there something I'm doing wrong?
    Attached Files

    #2
    Hello RookieTrader,

    Thank you for your post.

    I am not seeing any difference in the setup between your indicator directly on the chart and your ParabolicSAR2 in the script. What values are you expecting to see?

    If you compare the values from the output and the values of the indicator directly added to the chart by using the DataBox, are these different? If so, please provide a screenshot.



    I look forward to assisting further.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Hello Gaby,
      In Ninjascript, I'm trying to generate the same values as the red ParabolicSAR that's on the black and purple MACD in panel 2 to help calculate entries. And the values should be small, somewhere in between +20 to -20, like the red MACD indicator shows in the jpeg file (see MACD values on right axis in panel 2), but the values from the Ninjascript are +17,600 in the output window (see values on right axis, panel 1), around the same price as the NQ futures would be. So it seems that the ParabolicSAR isn't using the MACD values as the input data. So I'm asking, how would I accomplish that?
      (I'm not a coder. I just dabble. So I hope this explanation was thorough enough).

      What I'm currently using:
      "MACD2 = MACD(Close, 12, 26, 9);
      ParabolicSAR2 = ParabolicSAR(MACD2.Default, 0.02, 0.2, 0.02);​"

      Comment


        #4
        Hello RookieTrader,

        Thank you for your response.

        You will need to use the Input Series Variant version of the indicator in your script in order to supply an input series to ParabolicSAR.

        Please see the support article below which details why this is needed, and also provides a download link for the variant version of the indicator you'll need to use.



        Try using this version in your script, the values should then look a lot more similar.

        Please let me know if you have any further questions.
        Last edited by NinjaTrader_Gaby; 03-01-2024, 02:42 PM.
        Gaby V.NinjaTrader Customer Service

        Comment


          #5
          I used the download link from the webpage you sent me and got an error message (in the attached jpeg file). Is there an easy fix for this?
          Attached Files

          Comment


            #6
            I would still like to know if there's a solution to this problem, but I used a quick fix:
            1. I extracted the indicator files from "InputSeriesVariants"
            2. I copied the file I needed to the indicators folder ("ParabolicSARInput"), without using the Ninatrader "Import" feature
            3. Saved as "ParabolicSARInput2"
            4. Changed the "namespace" in "ParabolicSARInput2" from "NinjaTrader.NinjaScript.Indicators.InputSeriesVar iants" to "NinjaTrader.NinjaScript.Indicators"
            5. Compilied it
            6. Changed the indicator filename in the Ninjascript I was using from ParaboicSAR to ParabolicSARInput2. Example: from ParabolicSAR2 = ParabolicSAR(MACD2.Default, 0.02, 0.2, 0.02) to ParabolicSAR2 = ParabolicSARInput2(MACD2.Default, 0.02, 0.2, 0.02)
            7. Compiled it
            ... And it's working. Again, if there's a fix for the intial import error, please let me know. Thanks for your help.
            Last edited by RookieTrader; 03-01-2024, 10:01 PM.

            Comment


              #7
              Hello RookieTrader,

              I received this error as well and did something similar to use this version of the indicator. Since the method names are similar to the system indicator method names, this error will pop-up.
              Gaby V.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by DJ888, 04-16-2024, 06:09 PM
              4 responses
              11 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by terofs, Today, 04:18 PM
              0 responses
              5 views
              0 likes
              Last Post terofs
              by terofs
               
              Started by nandhumca, Today, 03:41 PM
              0 responses
              5 views
              0 likes
              Last Post nandhumca  
              Started by The_Sec, Today, 03:37 PM
              0 responses
              3 views
              0 likes
              Last Post The_Sec
              by The_Sec
               
              Started by GwFutures1988, Today, 02:48 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Working...
              X