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 fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,404 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              95 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              8 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              159 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              8 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X