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

Multi-Time Frame Parabolic SAR Issues.

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

    Multi-Time Frame Parabolic SAR Issues.

    My multi-time frame strategy isn't acting according to expectations. So, on a temporary basis, I decided to plot some objects representing different indicators to see what the computer is seeing.

    Code:
    AddDataSeries(Data.BarsPeriodType.Minute, 60);
    AddDataSeries(Data.BarsPeriodType.Minute, 240);
    AddDataSeries(Data.BarsPeriodType.Day, 1);
    
    _1DayHighEMA = EMA(Highs[3], 300);
    _1DayLowEMA = EMA(Lows[3], 300);
    _1DayPSAR = ParabolicSAR( Typicals[3], 0.02, 0.2, 0.02);
    Referencing the attached pic, you'll see the pink line represented by the _1DayHighEMA/_1DayLowEMA respectively is correct. The chart happens to be hourly and it has an hourly PSAR indicator added and the _1DayPSAR appears to be plotted very near the hourly values. Those values aren't correct. Any idea why?




    #2
    Are you loading at least 300 days when running the strategy?

    Comment


      #3
      Yes, the EMA's aren't the problem. In fact, all other multi time frame indicators, that I've used, work as expected. The daily PSAR plots the same values as the hourly PSAR. That's the issue.

      Comment


        #4
        Try using,

        _1DayPSAR = ParabolicSAR(BarsArray[3], 0.02, 0.2, 0.02);

        The code in @ParabloicSAR uses values from the 'High' and 'Low' series,
        so I'm guessing that passing 'Typicals' doesn't make a lot of sense ...

        Comment


          #5
          Worked great! Thanks!

          Comment


            #6
            Hi there
            I created a custom Parabolic strategy but it doesn't work at all, not sure why. I checked the settings from the source as well , all look good but still the strategy doesn't perform as expected.
            Could you help?

            Comment


              #7
              Hello honest-trader,

              If the strategy is applied to a chart, is there data with new bars appearing on the chart the Strategy is applied to?

              Is the strategy showing as enabled on the Strategies tab of the Control Center?

              If the strategy is in the Strategy Analyzer, is there data appearing on the Chart Display of the Strategy Analyzer?

              Importantly, are there errors appearing on the Log tab of the Control Center?

              Try testing the Sample MA Crossover strategy included with NinjaTrader on the same chart or Strategy Analyzer using the same instrument, bar type, interval, and date range.
              Do you see results with this strategy? (This would confirm for us data is available and the issue is with the logic in the custom script)

              If the strategy is getting data and the strategy is enabled or a backtest is run with no errors in the Log tab of the Control Center, then would likely indicate the logic conditions did not evaluate as true or orders are being ignored or cancelled.

              In order to better understand how the code is working, it will be necessary to use Print to see how the conditions are evaluating and enable TraceOrders to see if orders are being submitted, ignored, rejected, or cancelled.

              Below is a link to a forum post that demonstrates using prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.
              https://ninjatrader.com/support/foru...121#post791121

              Enable TraceOrders, print the time of the bar and all values used in the conditions that submit entry orders.

              Let me know if you need any assistance creating a print or enabling TraceOrders.

              Save the output from the output window to a text file and provide this with your reply.

              I'll be happy to assist with analyzing the output.
              Last edited by NinjaTrader_ChelseaB; 03-25-2021, 09:43 AM.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Hi Chelsea
                Thanks for the details.

                Link to screenshots of all strategy settings
                Free image hosting and sharing service, upload pictures, photo host. Offers integration solutions for uploading images to forums.

                Free image hosting and sharing service, upload pictures, photo host. Offers integration solutions for uploading images to forums.

                Free image hosting and sharing service, upload pictures, photo host. Offers integration solutions for uploading images to forums.

                Free image hosting and sharing service, upload pictures, photo host. Offers integration solutions for uploading images to forums.

                Free image hosting and sharing service, upload pictures, photo host. Offers integration solutions for uploading images to forums.


                Will expire in 1 week

                ParabolicSAR strategy - enter long once on the first bar only and short on 1st bar only as soon as the signals appear to buy or sell

                Let me know your thoughts please.

                Thanks

                Comment


                  #9
                  Hello honest-trader,

                  I think the condition may not be evaluating as true.

                  Without printing the values it is impossible to tell.

                  If you are not wanting to use prints to debug the script, you can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.

                  Let me know if you want to find out why the orders are not being placed using prints and TraceOrders and if you would like me to analyze the output saved to a text file.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Hi Chelsea

                    Thanks for the suggestions on NT Script services. Let me know some good/reputed service providers please.

                    Attached print text from Output window and Strategy backtest results.

                    Regards
                    H
                    Attached Files

                    Comment


                      #11
                      Hello honest-trader,

                      A member of the NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants

                      To save the output to a text file, right-click the NinjaScript Output window -> select Save As -> click Save.

                      I am seeing in this output the TraceOrders shows that orders are being submitted.

                      To confirm, if you right-click the chart the strategy is running on, select Strategy Performance -> select the strategy instance -> select Real-time & Historical, then in the Strategy Performance window select the Orders display, there are absolutely no orders appearing?

                      Further, I am not seeing the output from the prints that print all values in the conditions.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Hello honest-trader,

                        Thank you for your post.

                        You can search our list of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more:
                        You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

                        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem, LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

                        Let me know if I may be of further assistance.
                        Thomas C.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by yertle, Yesterday, 08:38 AM
                        7 responses
                        28 views
                        0 likes
                        Last Post yertle
                        by yertle
                         
                        Started by bmartz, 03-12-2024, 06:12 AM
                        2 responses
                        21 views
                        0 likes
                        Last Post bmartz
                        by bmartz
                         
                        Started by funk10101, Today, 12:02 AM
                        0 responses
                        6 views
                        0 likes
                        Last Post funk10101  
                        Started by gravdigaz6, Yesterday, 11:40 PM
                        1 response
                        9 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Started by MarianApalaghiei, Yesterday, 10:49 PM
                        3 responses
                        11 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Working...
                        X