| VarSinceLastAction as Number |
Example:
|
' This is a system Sub Main() For CurrentBar = BeginBar to EndBar I1 = GetValue("SMA", CurrentBar) I2 = GetValue("SMA", CurrentBar - 1) J1 = GetValue("LMA", CurrentBar) J2 = GetValue("LMA", CurrentBar - 1) If (J1 < I1) and (J2 > I2) then Buy(CurrentBar) If (J1 > I1) and (J2 < I2) then AddText(VarSinceLastAction) Sell(CurrentBar) End If Next If VarSinceLastAction < -4 then Sell(CurrentBar); End Sub |