Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Standard Deviation of 5 Day Trade Range Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
dnhoward
Posted : Thursday, January 12, 2012 5:50:28 PM
Registered User
Joined: 1/5/2007
Posts: 21

Hello.  Mathmatically, I'm looking for StandardDeviation(TradeRange(5)).  I have looked at StdDev realcode, but have no conclusion how to get what I want.  Can you help?

Many Thanks!

Bruce_L
Posted : Friday, January 13, 2012 8:19:07 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Standard Deviation of Range
'|******************************************************************
'# Period = UserInput.Integer = 5
Static SumC As Single
Static SumSq As Single
If isFirstBar Then
    SumC = 0
    SumSq = 0
End If
SumC += Price.High - Price.Low
SumSq += (Price.High - Price.Low) ^ 2
If CurrentIndex >= Period Then
    SumC -= Price.High(Period) - Price.Low(Period)
    SumSq -= (Price.High(Period) - Price.Low(Period)) ^ 2
End If
If CurrentIndex >= Period - 1 Then
    Plot = Math.Abs((SumSq - SumC ^ 2 / Period) / Period) ^ .5
Else
    Plot = Single.NaN
End If

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
dnhoward
Posted : Wednesday, January 18, 2012 6:36:09 AM
Registered User
Joined: 1/5/2007
Posts: 21
Thanks Bruce!  I continue to learn from your examples.
Bruce_L
Posted : Wednesday, January 18, 2012 8:14:15 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.