defparam cumulateorders= false
if time>084000 and time<173000 then
journee=1
else
journee=0
endif
timeframe (21 minutes)
if Supertrend[1,1]<close then
haut=1
else
haut=0
endif
if supertrend[4,3]>close then
bas=1
else
bas=0
endif
timeframe (1 minute)
ST = Stochastic[1,3](close)
TRA = triangularAverage[8] (close)
n=1
if (dhigh(0)-close)>((dhigh(0)-dlow(0))/2.9) then
stopa=0
else
stopa=1
endif
if (close-dlow(0))>((dhigh(0)-dlow(0))/2.9) then
stopv=0
else
stopv=1
endif
//ACHAT
if ((longonmarket and (close-tradeprice)>0) or not onmarket) and stopv=0 and bas=1 and journee=1 and ST > 50 and close<TRA THEN
sellshort n share at market
ENDIF
IF ((shortonmarket and (tradeprice-close)>1) or not onmarket) and stopa=0 and haut=1 and journee=1 and ST < 50 and close>TRA THEN
BUY N SHARE AT MARKET
endif
set target profit 16
IF longonmarket and (barindex-tradeindex)>960 then
sell n share at market
endif
if shortonmarket and (barindex-tradeindex)>700 then
exitshort n share at market
endif