Syntax
Public Function StochasticOScillator(chart_ID As Long, PeriodK As Integer, SlowingK As Integer, PeriodD As Integer, Ma As ENUM_MA_METHOD) As String
Description
The Stochastic Oscillator is a popular indicator that shows where a securitys price has closed in proportion to its closing price range over a specified period of time.
The Stochastic Oscillator has two components: %K and %D. %K is most often displayed as a solid line and %D is often shown as a dotted line.
The most widely used method for interpreting the Stochastic Oscillator is to buy when either component
Another way to interpret the Stochastic Oscillator is to buy when %K raises above %D, and conversely, sell when %K falls below %D.
Parameters
Key | Description |
chart_ID | Chart identifier, 0 is the current chart, a value of type Long. |
The firstcalculation period, on which first moving average indicator will be calculated, a value of type Integer. |
|
The moving average slowing value, a value of type Integer. | |
The secondcalculation period, on which secondmoving average indicator will be calculated, |
|
MA | The moving average type, a value of type ENUM_MA_METHOD. |
Return value
Returns the handles of a technical indicator, in case of failure returns an empty string.
Sample
Public Sub main()AlertMessage (StochasticOScillator(0,10,3,3,0))'Draws the indicator on the chart and shows an Alert Message with the indicator name.End Sub
See Also