DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time.
DEFPARAM FLATBEFORE = 070000
// Cancel all pending orders and close all positions at the "FLATAFTER" time
DEFPARAM FLATAFTER = 181500
OTD = (Barindex - TradeIndex(1) > IntradayBarIndex)
// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// Conditions to enter long positions
indicator1 = BollingerUp[20](close)
c1 = (close > indicator1)
indicator2 = Volume
c2 = (indicator2 >= 8000)
IF (c1 AND c2) AND not daysForbiddenEntry AND OTD THEN
BUY 10 PERPOINT AT MARKET
ENDIF
// Conditions to enter short positions
indicator3 = BollingerDown[20](close)
c3 = (close < indicator3)
indicator4 = Volume
c4 = (indicator4 >= 8000)
IF (c3 AND c4) AND not daysForbiddenEntry AND OTD THEN
SELLSHORT 10 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 30
SET TARGET pPROFIT 60