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

NT7 conversion

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

    NT7 conversion

    Hi,
    * In my NT7 strategy I'm calling another indicator without any problems, but as I convert the strategy to NT8 I get the following error: "No overload for method "...xyz" takes 1 arguments" in another instance I get "No overload for method "..abc" takes 2 arguments.

    * For NT7 I have if(!Historical)...., what's the NT8 conversion?
    * For NT7 I have "+ (SystemPerformance.RealtimeTrades.Count)", what's the NT8 conversion?
    * For NT7 I have "+ ((int)SystemPerformance.RealtimeTrades.TradesPerfo rmance.Currency.DrawDown)", what's the NT8 conversion?

    Thanks

    #2
    Hello 2Look4me,

    Thanks for the note.

    For the indicator arguments, you can type the name of the indicator, then add a '('. After this, you will see a list of valid argument overloads in the NinjaScript editor.

    Historical has been replaced with the state State.Historical. In NinjaTrader 8, you would check for the historical state like so: if(State == State.Historical)

    The SystemPerformance class remains. The Count property is now TradesCount.

    https://ninjatrader.com/support/help...collection.htm - TradeCollection

    Drawdown still exists in the TradePerformanceValues class:

    https://ninjatrader.com/support/help...ancevalues.htm

    The code-breaking changes page is a good resource for finding these items:

    https://ninjatrader.com/support/help...ng_changes.htm

    Please let me know if I can assist further.
    Last edited by NinjaTrader_ChrisL; 11-07-2018, 12:50 PM. Reason: Fixed Drawdown syntax
    Chris L.NinjaTrader Customer Service

    Comment


      #3

      Chirs, thanks for the speedy reply.

      After making the changes to:
      Draw.TextFixed(this,"Drawdown", "Drawdown: " + (SystemPerformance.AllTrades.TradesPerformance.Cur rency.DrawDown), TextPosition.TopLeft);
      I'm getting the following error: NinjaTrade.Cbi.TradesPerformanceValues does not contain a definition for “DrawDown” and no extension……

      Thanks

      Comment


        #4
        Hello 2Look4me ,

        Thank you for the reply.

        It looks like the 'd' in "down" is not capital, changing that should work.

        Drawdown

        Please let me know if I can assist further.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          That shouldn't make a difference in the error message since "Drawdown" is a text inside quote marks.

          Comment


            #6
            Hello 2Look4me ,

            Thanks for the reply.

            The correct syntax would be written like so:

            Code:
            Draw.TextFixed(this,"Drawdown", "Drawdown: " + (SystemPerformance.AllTrades.TradesPerformance.Currency.Drawdown), TextPosition.TopLeft);
            Please let me know if I can assist further.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Thanks Chris that worked. Also with regards to one of my initial questions, In NT7 I'm calling an indicator (ATR as a trailing indicator)
              double ATRtrail = ATRTrailStop(4,3).ATRstop[0]; Where 4=double multi, 3=int period.

              In the conversion to NT8, as I call the indicator the following error appears: "No overload for method "....." takes 2 arguments . The valid argument overload in the NinjaScript editor is " (ISeries<double>input)". What is that referring to and how to get rid of the error in NT8?

              Comment


                #8
                Hello 2Look4me,

                Thanks for the reply.

                The argument list needs a series to process. For example: ATRTrailStop(Close, 4,3).ATRstop[0]

                That should fix it. Please let me know if I can assist further.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  Sorry Chris, but ATRTrailStop(Close,4,3).ATRstop[0] didn't help because the error now is that it takes 3 arguments. "No overload for method "....." takes 2 arguments

                  Comment


                    #10
                    Hello 2Look4me,

                    Thank you for the reply.

                    When you type "ATRTrailStop(", what do you see for the first parameter list?

                    I look forward to your reply.
                    Chris L.NinjaTrader Customer Service

                    Comment


                      #11
                      When typed "ATRTrailStop(" the first parameter that shows up is " (ISeries<double>input)"

                      Comment


                        #12
                        Hello 2Look4me,

                        Thanks for the reply.

                        There should be other overloads for the proper arguments to provide. Please try using the arrow keys on your keyboard to find the proper overload (One that includes the series and both of the other parameters).

                        Is the ATRTrailStop open source? If so could you export it then post it here?

                        I look forward to your reply.
                        Chris L.NinjaTrader Customer Service

                        Comment


                          #13
                          Thanks again, I'm including the attachment.
                          ATRTrailStop2.zip

                          Comment


                            #14
                            Hello 2Look4me,

                            Thanks for the reply.

                            Your properties do not have the [NinjaScriptProperty] decorator. This must be present, then you will see the properties in the argument list of ATRTrailStop.

                            Code:
                              [Description("ATR period")]
                                    [Category("Parameters")]
                                    [NinjaScriptProperty]
                                    public int Period
                                    {
                                        get { return period; }
                                        set { period = Math.Max(1, value); }
                                    }
                            
                                    [Description("ATR multiplication")]
                                    [Category("Parameters")]
                                    [NinjaScriptProperty]
                                    public double Multi
                                    {
                                        get { return multi; }
                                        set { multi = Math.Max(0, value); }
                                    }
                            Please let me know if I can assist futher.
                            Chris L.NinjaTrader Customer Service

                            Comment


                              #15
                              Chris, I'm still a bit confused after reading the NinjaScripProperty Attribute help guide. Upon calling a custom indicator when and what determines the use of this attribute? Because I have other indicators that are being called, but I'm not having any issues without the NinjaScriptProperty attribute added.

                              Also, I'm getting the following error after adding the attribute to the indicator : " The indicator is inaccessible due to its protection level".

                              Thanks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by junkone, Today, 11:37 AM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by frankthearm, Yesterday, 09:08 AM
                              11 responses
                              41 views
                              0 likes
                              Last Post frankthearm  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              5 responses
                              35 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by proptrade13, Today, 11:06 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              34 views
                              0 likes
                              Last Post love2code2trade  
                              Working...
                              X