Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculation of standard deviation

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

    Calculation of standard deviation

    Form my point of view calculation of standard deviation should be changed to the more common way:
    SQRT ( 1/(N-1) SUM (POWER(X(i) - SMA(i))))

    Actual calculation in NinjaTrader is SQRT ( 1/N SUM (POWER(X(i) - SMA(i))))

    With this calculation there are small differences to other charting applications, Excel, Calculators. It would be easier and more comparable to transfer a system to NinjaTrader.

    See also: http://www.ninjatrader-support.com/v...ead.php?t=7447

    implementation is easy:

    in StdDev.cs

    Value.Set(Math.Sqrt(sum / Math.Min(CurrentBar + 1, Period)));

    has to be changed to

    Value.Set(Math.Sqrt(sum / Math.Min(CurrentBar + 1, Period-1)));

    (maybe an extra check vor div by zero)

    Any support for this suggestion?

    #2
    You can of course always just create your own version of the same indicator using the alternate calculation you proposed.
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    148 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    5 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    5 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,282 views
    0 likes
    Last Post Leafcutter  
    Working...
    X