//-------------------------------------------------------------------------
// Hoofd code : PSAR
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Hoofd code : sar
//-------------------------------------------------------------------------
// Hoofd code : OBV KOERS
//-------------------------------------------------------------------------
// Definitie van code parameters
DEFPARAM CumulateOrders = False // Opstapelen posities gedeactiveerd
//dive by zero fix
Gap = Close-CustomClose[1]
IF Gap = 0 THEN
Gap = 0.000001
ENDIF
// Condities om long posities te openen
indicator1 = SAR[0.02,0.02,0.2]
c1 = (indicator1 CROSSES UNDER close)
BUDGET = ((10000 + STRATEGYPROFIT) *5)/CLOSE
AANTAL = ROUND(BUDGET)
IF c1 THEN
BUY AANTAL CONTRACT AT MARKET
AANKOOP = CLOSE
ENDIF
IF CLOSE < (0.99*AANKOOP) THEN
SET STOP pTRAILING 1
ENDIF
IF CLOSE > (1.01*AANKOOP) THEN
SET STOP pTRAILING 1
ENDIF