defparam cumulateorders=false defparam flatafter=200000 //cloture des positions ouvertes à 20h00 // --- parametres HeureDebut = 080000 //horaire de debut de trading HeureFin = 200000 //horaire de fin de trading SeuilATR = 30 //seuil maximum de l'ATR pour la prise de position PerteMax = 300 //seuil de perte maximum jour en monnaie // --------------------- timeframe(2 minutes, updateonclose) st2=Supertrend[3,10] timeframe(30 seconds, updateonclose) if day<>day[1] then pnl=strategyprofit trading=1 endif if strategyprofit<>strategyprofit[1] then if strategyprofit<=pnl-pertemax then trading=0 endif endif st1=Supertrend[3,10] atr=AverageTrueRange[14](close) sto=Stochastic[4,1](close) buyc = sto crosses over 20 and close>st1 and atr<=seuilatr*pointsize timec = time>=HeureDebut and time