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

standard deviation of R multiples

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

    standard deviation of R multiples

    this is my first attempt at trying to figure out my system quality number (SQN). my strategy takes about 60-100 trades/4-5 weeks.. so my first sample data set is from 77 trades..market replay (TF 12-14).

    results in terms of R:

    77 trades= 11.82R
    11.82 / 77=.15 (mean)
    expectancy=.15
    SQN=?
    I cant get the SQN without the standard deviation of R multiples..
    SQN is the ratio of the expectancy to the standard deviation
    how do I get the standard deviation?

    I did the above math w pen paper and calc..but I cannot figure out how to get the standard deviation from the data set of R multiples. there are SD calcs on line..you simply input the data set numbers...but how are losses input on these calcs?

    basically what I need is ninja script code to show all of this.. on the performance report would be ideal. can someone please point me in the right direction?

    #2
    Hello shooly76,

    Thank you for your post.

    Store the values of R as a DataSeries, then pass the DataSeries to the StdDev() indicator method.

    Comment


      #3
      There wouldn't be a way to pass the end result to the performance report, and would need to either be output via Print() or stored in an external file.

      Comment


        #4
        thanks..

        if Im looking at my performance report, how can I view my trades in values of R? I need to convert P/L$ (trades) data to R values before I can achieve the SD and finally the SQN.

        all I can see is the actual profit/loss $ amount for each trade. I previously calculated the R w pen and paper and calc..but have no clue how to do this in NT..

        I hate to ask this..but can you provide a step by step guide for this? or is there a section in NT help?

        Comment


          #5
          Hello shooly76,

          Thank you for your response.

          What calculation are you using for the R Value? Have you looked into the R-Squared?

          R-Squared:

          Comment


            #6
            R calculation:

            profit and loss of each trade divided by initial risk $amount= R
            PnL / initial risk per trade

            Expectancy calculation:

            total R for sample data set divided by total number of trades=expectancy
            R / #of trades

            ex.

            128 trades

            27.84R / 128= .22

            expectancy .22

            this is about 10 weeks worth of trade data (all market replay)..I have about 6 more months of replay performance..all similar to above results..I also performed 10,000 monte carlo sims..all nice results..thanks Van K Tharp..and ninja trader!

            for ninja trader 8:

            Performance report to include:

            option to view PnL per trade in terms of R..not just % and $ amount

            expectancy of strategy

            SQN of strategy

            Comment


              #7
              HAHA..I meant the above would be nice to see in NT8!

              Comment


                #8
                Hello shooly76,

                Thank you for your response.

                I will forward your suggestion to our development team.

                Comment


                  #9
                  Originally posted by shooly76 View Post
                  R calculation:

                  profit and loss of each trade divided by initial risk $amount= R
                  PnL / initial risk per trade

                  Expectancy calculation:

                  total R for sample data set divided by total number of trades=expectancy
                  R / #of trades

                  ex.

                  128 trades

                  27.84R / 128= .22

                  expectancy .22

                  this is about 10 weeks worth of trade data (all market replay)..I have about 6 more months of replay performance..all similar to above results..I also performed 10,000 monte carlo sims..all nice results..thanks Van K Tharp..and ninja trader!

                  for ninja trader 8:

                  Performance report to include:

                  option to view PnL per trade in terms of R..not just % and $ amount

                  expectancy of strategy

                  SQN of strategy
                  You can right now write optimization criteria for SQN and Expectancy, and get report results based and optimized on those criteria. Just follow the paradigm of the existing optimization types. They are all open, text, .cs files.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by junkone, Today, 02:19 PM
                  1 response
                  13 views
                  0 likes
                  Last Post junkone
                  by junkone
                   
                  Started by strategist007, Yesterday, 07:51 PM
                  1 response
                  18 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by AaronKTradingForum, Today, 02:37 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post AaronKTradingForum  
                  Started by DJ888, 04-26-2024, 10:57 PM
                  1 response
                  12 views
                  0 likes
                  Last Post NinjaTrader_Eduardo  
                  Started by rbeckmann05, Yesterday, 06:48 PM
                  2 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Working...
                  X