| Parabolic(Initialization, Acceleration factor, Maximum Acc. Factor) as Array |
This function has three parameters:
| Initialization | Enter the initialization factor, typically 0.02. |
| Acceleration factor | Enter the acceleration factor, typically 0.02. |
| Maximum Acc. Factor | Enter the maximum acceleration factor, typically 0.4. |
Example:
|
' This is a system based on the Parabolic SAR Sub Main() SAR = Parabolic(0.02, 0.02, 0.4) For CurrentBar = BeginBar + 1 to EndBar SAR1 = SAR(CurrentBar) SAR2 = SAR(CurrentBar - 1) AOsc = GetValue("Aroon Up", CurrentBar) - GetValue("Aroon Down", CurrentBar) P1 = Close(CurrentBar) P2 = Close(CurrentBar - 1) If (P1 > SAR1) and (P2 < SAR2) then If AOsc > 50 then Buy(CurrentBar) End If If (P1 < SAR1) and (P2 > SAR2) then If AOsc <= 0 then Sell(CurrentBar) End If Next End Sub |