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

Swing Indicator using Open/Close prices

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

    Swing Indicator using Open/Close prices

    Is there a way to modify a copy of the Swing Indicator to use the Close prices instead of High/Low?

    #2
    Hello cliftoneparker,

    Thank you for your inquiry.

    You actually don't have to modify the indicator itself to do this, you can simply use a 1 period SMA of close prices as the input for the Swing indicator:



    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      That worked!
      I'm trying to do the same thing with Trend Lines and AutoTrendLine but it doesn't seem to work.
      Also, I can't get AutoTrendLine to work on Panel except the pricing panel. No Indicator in the input series works.
      Thoughts?

      Comment


        #4
        Hello cliftoneparker,

        Thank you for your reply.

        Not every indicator can accept another indicator as input - they have to be specifically programmed to do so. The Autotrendline indicator found on our publicly available User App Share at the link below is not programmed to accept an indicator as input:

        This is a conversion of the NT7 indicator AutoTrendLine. Uses the swing indicator to place a trend line, based on the swing strength value. A cross of the trend line is indicated on chart with an arrow and is sent to the Alerts Panel. New in this version is a transparent plot that can be […]


        However, the built in Trend Lines indicator is. Here's a screenshot showing one Trend Lines indicator applied using a 1 period SMA for the input (the golden line) vs just applied to the primary series itself (the reddish line):

        Click image for larger version

Name:	2022-01-05_07-32-52.png
Views:	330
Size:	108.0 KB
ID:	1184470

        Please let us know if we may be of further assistance to you.

        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 add-ons 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.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thank you.
          I can't get Trendlines Indicator to show up in Strategy Analyzer Charts but it works fine on a regular chart. Is there any way to have the Trendlines Indicator to work with SA Charts?

          Comment


            #6
            Hello cliftoneparker,

            Thank you for your note.

            In looking at this we discovered there is an issue with the built in Trend Lines indicator in the Strategy Analyzer. It makes reference to ChartBars without first checking if ChartBars is null, and in the Strategy Analyzer it is null.

            From our help guide on ChartBars:

            "A ChartBars object will ONLY exist should the hosting NinjaScript type be loaded through a Chart. For example, a Strategy would have access to a ChartBars property when running on a Chart, but would NOT when loaded through the Strategies Grid or Strategy analyzer. "

            Since the strategy is not being loaded on an actual normal chart, we get an error when trying to backtest the strategy calling it.

            I'm attaching a modified version of the TrendLines indicator that checks if the ChartBars are null and if so, does not do the custom rendering for the indicator (meaning you still won't be able to see it in the Strategy Analyzer). However, plot values would be available in your Strategy still, as it would check different values instead of using ChartBars.

            I will also report this to our QA team to have them look at it.

            Please let us know if we may be of further assistance to you.
            Attached Files
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Will I be notified if they make any changes to the trendline indicator?

              Comment


                #8
                Hello cliftoneparker,

                Thank you for your note.

                I've noted your ticket in the ticket for development and will let you know anything I hear from them.

                Please let us know if we may be of further assistance to you.
                Kate W.NinjaTrader Customer Service

                Comment


                  #9
                  has there been any update on the trendline indicator? Should I assume trendlineindicator2 will work correctly or should I not use it?
                  Thaks
                  Clif

                  Comment


                    #10
                    Hello cliftoneparker,

                    Thank you for your reply.

                    Our development team is rather backed up at the moment, but this is currently on our QA team's plate to take a look at. Once they have their findings and pass this along to the development team it will likely take some time for a fix to be added. In the meantime the trendlines2 indicator linked above will avoid the error.

                    Please let us know if we may be of further assistance to you.
                    Kate W.NinjaTrader Customer Service

                    Comment


                      #11
                      I'm having an issue with Strategy Analyzer. Sometimes when I change an input slightly it causes Strategy Analyzer to stop running past a certain date. for example if I change trailing stop from .006 to .005 then the backtest which normally would run to the end date will stop prematurely. How do I troubleshoot this issue?

                      Comment


                        #12
                        Hello cliftoneparker,

                        Thank you for your reply.

                        I would generally encourage you to start new forum threads for new questions unrelated to a prior inquiry.

                        What you're experiencing can occur if a historical overfill whereby 3 orders (entry/target/stop) filled on the same bar happens. For example:

                        1) Enter Long is triggered on Bar x

                        2) Enter Long fills immediately in the fill engine and throws the OnExecutionUpdate event for OrderState.Filled

                        3) This triggers the strategy logic to submit an ExitLongLimit and ExitLongStopMarket (still on Bar x)

                        4) The Limit Price is below the High of Bar x + 1 and the Stop Price is above the Low of Bar x + 1 → Therefore these orders also fill immediately

                        5) This results in a historical overfill which managed NS is not designed to handle and anything occurring from this point forward is not going to work correctly.

                        6) Strategy calls EnterLong on Bar x + 1 → Order reaches State.Working and nothing else happens.

                        I would need to take a look at the strategy in order to see if this is the case, however. Can you supply the strategy along with settings for the Strategy Analyzer that will replicate this scenario? You can export the strategy from Tools > Export > NinjaScript Add-on. Do not check the box to export as a compiled assembly or I will not be able to review the logic. Please attach the .Zip file generated to your reply. Also, please provide a screenshot of your settings in the Strategy Analyzer for a run that did not complete as expected.

                        Thanks in advance; I look forward to assisting you further.
                        Kate W.NinjaTrader Customer Service

                        Comment


                          #13
                          I'm not sure what to do now without making you more upset. Should I upload the docs again that I uploaded on the new thread. (I assumed you wanted me to start a new thread based on your comments above)

                          Comment


                            #14
                            Hello cliftoneparker,

                            Thank you for you reply.

                            I'm just letting you know what to do in the future - for this particular issue we've replied here, so please continue to reply on this thread. In the future, please create a new thread for a separate issue.

                            Thanks in advance; I look forward to assisting you further.
                            Kate W.NinjaTrader Customer Service

                            Comment


                              #15
                              If I change trailing stop from .01 to .005 then the backtest which normally would run to the end date will stop prematurely. How do I troubleshoot this issue?
                              See attached strategy and screenshots.
                              Thanks
                              Clif
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Sparkyboy, Today, 10:57 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Sparkyboy  
                              Started by TheMarlin801, 10-13-2020, 01:40 AM
                              21 responses
                              3,917 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by timmbbo, 07-05-2023, 10:21 PM
                              3 responses
                              152 views
                              0 likes
                              Last Post grayfrog  
                              Started by Lumbeezl, 01-11-2022, 06:50 PM
                              30 responses
                              811 views
                              1 like
                              Last Post grayfrog  
                              Started by xiinteractive, 04-09-2024, 08:08 AM
                              3 responses
                              11 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Working...
                              X