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

Optimization on Max. R^2 (R-Squared)

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

    Optimization on Max. R^2 (R-Squared)

    Hi!

    I want the optimizer to give me the most linear and steady upward equity curve. I thought R^2 is the right Thing but I think it is not.

    I thought R^2 must be between 0 and 1 but I am getting results with way more than 1. Furthermore, very similar equity curves have very different R^2 values (12 compared to 2).

    1. Can anyone explain what the R^2 optimization exactly does? The formula in NT Help guide is not helpful (where is the difference between "Total Trades" and "Summation of Trades"?)

    2. Does anyone have an optimizer to find the most linear and steady upward equity curve?

    (I found this but unfortunately only for NT7 and was unable to make it work in NT8: https://futures.io/ninjatrader/14852...ion-types.html )

    Thanks in advance!

    #2
    Hello KirkHammett,

    I'm not aware of an existing Optimization Fitness script or Optimizer script with this custom logic for NinjaTrader 8.

    This thread will remain open for any community members that may know of where to obtain this or would like to code this as a convenience for you.

    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 business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply.

      Can you explain to me, what the R^2-optimization does? I just would like to understand it.

      Comment


        #4
        Hello KirkHammett,

        Max R2 is explained in the helpguide at the following section,


        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Hi Alan!

          Thanks for the reply. As mentioned in my first post I read through NT Help guide but I didnt understand it.

          1. What is meant with "fitted" regression line? I of course know what's a regression but not what the help guide means with "fitted".

          2. In the formula below the explanation: Where is the difference between "Total Trades" and "Summation of Trades" in the formula?

          Thanks!

          Comment


            #6
            Hello KirkHammett,

            Thank you for writing in.

            Both a Fitted Regression Line and the Coefficient of Determination formula are popular statistics concepts which you can find better/more in-depth explanation for with a web search, however I provided brief descriptions below.

            A fitted regression line on a graph represents of the mathematical regression equation for your data. Use fitted regression lines to illustrate the relationship between a predictor variable (x-scale) and a response variable (y-scale) and to evaluate whether the model fits your data.

            "Total Summation of Trades" is rSquaredSumOfXSq and "Summation of Trades ^2" is rSquaredSumOfX * rSquaredSumOfX. R Squared is the same as Coefficient of Determination, which I would suggest doing a web query for.

            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Radano, 06-10-2021, 01:40 AM
            19 responses
            606 views
            0 likes
            Last Post Radano
            by Radano
             
            Started by KenneGaray, Today, 03:48 AM
            0 responses
            4 views
            0 likes
            Last Post KenneGaray  
            Started by thanajo, 05-04-2021, 02:11 AM
            4 responses
            470 views
            0 likes
            Last Post tradingnasdaqprueba  
            Started by aa731, Today, 02:54 AM
            0 responses
            5 views
            0 likes
            Last Post aa731
            by aa731
             
            Started by Christopher_R, Today, 12:29 AM
            0 responses
            11 views
            0 likes
            Last Post Christopher_R  
            Working...
            X