WilliamsR(Period) as Array

WilliamsR function returns an array containing the Williams %R indicator of the select period.

 

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

 

Example:

' This system is based on Williams %R
Sub Main()
  TArr = WilliamsR(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