Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Normal Distribution function

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

    Normal Distribution function

    Good Evening,

    I'm trying to pull the normal distribution value of a zscore but I am not able to pull in standard C# Normal Distribution and I do not see NormDist in the Math class. Is there a way to do this in NinjaScript?

    #2
    I believe NormalDistribution is part of the .NET Framework 4.8's charting class not the math class.

    See for instance: https://learn.microsoft.com/en-us/do...ramework-4.8.1

    What is it you're trying to do?
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Originally posted by QuantKey_Bruce View Post
      I believe NormalDistribution is part of the .NET Framework 4.8's charting class not the math class.

      See for instance: https://learn.microsoft.com/en-us/do...ramework-4.8.1

      What is it you're trying to do?
      Hey Bruce, I'm trying to calculate the one and two sided percentile of a Z-Score. In excel this is as simple as:
      One Sided =NORM.S.DIST(X,FALSE)
      Two Sided =NORM.S.DIST(X,TRUE)

      I thought there would surely be a normal distribution function in NinjaScript but did not find one and can not figure out how to pull in a normal distribution method into NT using C#

      Last edited by ChrisR; 05-06-2023, 07:28 AM.

      Comment


        #4
        ChrisR You mean like this? https://github.com/ovnisoftware/Norm...istribution.cs
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          Or you may want to do it like this, which is more written out even if less efficient: https://bytes.com/topic/c-sharp/answ...l-distribution
          Bruce DeVault
          QuantKey Trading Vendor Services
          NinjaTrader Ecosystem Vendor - QuantKey

          Comment


            #6
            Perfect thanks, got it loaded, now just trying to check the math. Went with the second option you found since it has a bool for cumulative.
            Last edited by ChrisR; 05-06-2023, 06:15 PM.

            Comment


              #7
              works great, thanks as always.

              Comment


                #8
                You're welcome.
                Bruce DeVault
                QuantKey Trading Vendor Services
                NinjaTrader Ecosystem Vendor - QuantKey

                Comment


                  #9
                  Hello ChrisR,

                  Thanks for your post.

                  I am happy to hear you found a solution.

                  NinjaTrader does not have a NormalDistribution method or property available to use.

                  This would require custom logic to accomplish and the examples QuantKey_Bruce shared demonstrate how this could be done as you have noted.

                  <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  649 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  370 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  109 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  574 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  576 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X