StochK(Period) as Array

StochK returns an array containing the stochastic of the selected period.

 

This function has one parameter:
Period   Enter the period to calculate the Stochastic.

 

Example:

' This system is based on Stochastic K%
Sub Main()
  TArr = StochK(10)
  For CurrentBar = BeginBar + 1 to EndBar
    If (TArr(CurrentBar) > 20) and (TArr(CurrentBar - 1) < 20) then Buy(CurrentBar)
    If (TArr(CurrentBar) < 80) and (TArr(CurrentBar - 1) > 80) then Sell(CurrentBar)
  Next
End Sub