Nicolas for whatever reason my code started working without much changes by me. The trades now close and my latest version is:
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
Defparam FLATAFTER = 083000
// Conditions to enter long positions
indicator1 = MACDline[12,26,9](close)
indicator2 = ExponentialAverage[9](MACDline[12,26,9](close))
c1 = (indicator1 CROSSES OVER indicator2)
IF (Time >= 054500) AND (Time <= 0715000) AND c1 THEN
BUY 2 PERPOINT AT MARKET
ENDIF
// Conditions to enter short positions
indicator1 = MACDline[12,26,9](close)
indicator2 = ExponentialAverage[9](MACDline[12,26,9](close))
c2 = (indicator1 CROSSES UNDER indicator2)
IF c2 THEN
SELLSHORT 1 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET STOP %LOSS 0.4
Set target PPROFIT 18