DEFPARAM CumulateOrders = False
ONCE Distanza = 6 * PipSize
ONCE Pips = 5 * PipSize
ONCE TP = 5
ONCE SL = 5
IF OpenTime = 101500 THEN
Massimo = highest[2](high) + Pips
Minimo = lowest[2](low) - Pips
ENDIF
IF (OpenTime >= 101500) AND (OpenTime <= 170000) THEN
// Long
IF close > (Massimo + Distanza) THEN
BUY 1 Contract at Massimo LIMIT
ELSIF close < (Massimo - Distanza) THEN
BUY 1 Contract at Massimo STOP
ELSE
//BUY 1 Contract at MARKET
ENDIF
//Short
IF close > (Massimo + Distanza) THEN
SELLSHORT 1 Contract at Massimo STOP
ELSIF close < (Massimo - Distanza) THEN
SELLSHORT 1 Contract at Massimo LIMIT
ELSE
//SELLSHORT 1 Contract at MARKET
ENDIF
ENDIF
SET TARGET pPROFIT TP
SET STOP pLOSS SL
GraphOnPrice Massimo coloured("Blue")
GraphOnPrice Minimo coloured("Red")