//-------------------------------------------------------------------------
// Code principal : DAX 40 M1
//-------------------------------------------------------------------------
// Définition des paramètres du code
DEFPARAM CumulateOrders = False // Cumul des positions désactivé
ONCE c = 14.0
ONCE l = 3.0
timeEnterBefore = time >= 083000
timeEnterAfter = time <= 170000
// Conditions pour ouvrir une position acheteuse
indicator1 = ExponentialAverage[c](close)
indicator2 = Average[l](close)
c1 = (indicator1 CROSSES OVER indicator2)
indicator3 = RSI[7](close)
c2 = (indicator3 > 50)
indicator4 = MACD[5,8,9](close)
c3 = (indicator4 > 0)
IF c1 AND c2 AND c3 THEN
BUY 2 SHARES AT MARKET
ENDIF
// Conditions pour fermer une position acheteuse
indicator5 = Average[l](close)-3*std[l](close)
c4 = (close CROSSES UNDER indicator5)
IF c4 THEN
SELL AT MARKET
ENDIF
// Conditions pour ouvrir une position en vente à découvert
indicator6 = ExponentialAverage[c](close)
indicator7 = Average[l](close)
c5 = (indicator6 CROSSES UNDER indicator7)
indicator8 = RSI[7](close)
c6 = (indicator8 < 50)
indicator9 = MACD[5,8,9](close)
c7 = (indicator9 < 0)
IF c5 AND c6 AND c7 THEN
SELLSHORT 2 SHARES AT MARKET
ENDIF
// Conditions pour fermer une position en vente à découvert
indicator10 = Average[l](close)+3*std[l](close)
c8 = (close CROSSES OVER indicator10)
IF c8 THEN
EXITSHORT AT MARKET
ENDIF