// Définition des paramètres du code
DEFPARAM CumulateOrders = True // Cumul des positions désactivé
Tenkansen = (highest[9](high)+lowest[9](low))/2
Kijunsen = (highest[26](high)+lowest[26](low))/2
SenkouSpanA = (Tenkansen[26]+Kijunsen[26])/2
SenkouSpanB = (highest[52](high[26])+lowest[52](low[26]))/2
STOK=Stochastic[14,5](close)
STOD=Average[5](Stochastic[5,3](close))
//STOK=Stochastic[5,3](close)
//STOD=Average[3](Stochastic[5,3](close))
myADX=ADX[14]
ADXtrend=myADX>23
// Conditions pour ouvrir une position acheteuse
//oversold = STOK CROSSES OVER STOD
//buycloud=open > SenkouSpanA or open > SenkouSpanB and Tenkansen > Kijunsen
//IF oversold and buycloud and ADXtrend THEN
//BUY 1 CONTRACT AT MARKET
//ENDIF
//if longonmarket and STOK CROSSES UNDER STOD then
//sell 1 contract at market
//Endif
// Conditions pour ouvrir une position en vente à découvert
overbought = STOK crosses under STOD
sellcloud = open < SenkouSpanA or open < SenkouSpanB and Tenkansen < Kijunsen
IF overbought and sellcloud and ADXtrend THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
if shortonmarket and STOK CROSSES over STOD then
exitshort 1 contract at market
Endif
// Stops et objectifs
set stop %loss 2
//set target %profit 3