Bonsoir,
je reviens avec le code modifié mais cela ne donne pas les résultats escomptés puisque je constate toujours quelques signaux en daily sur octobre 2021 puis plus rien après.
//PRC_Supertrend+CCI | indicator
//06.01.2021
//Nicolas @ http://www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT5 version
timeframe(Daily,updateonclose)
// — settings
CCIPeriodD=50 // CCI indicator period
ATRPeriodD=5 // ATR indicator period
LevelD=0 // CCI activation level
// — end of settings
icciD = CCI[CCIPeriodD](typicalPrice)
iatrD = AverageTrueRange[ATRPeriodD](close)
TrendUpD=0.0
TrendDownD=0.0
SignUpD=0.0
SignDownD=0.0
if(iCCID>=LevelD and iCCID[1]<LevelD) then
TrendUpD=TrendDownD[1]
endif
if(iCCID<=LevelD and iCCID[1]>LevelD) then
TrendDownD=TrendUpD[1]
endif
if(iCCID>LevelD) then
TrendUpD=low-iATRD
r=0
g=255
if(TrendUpD<TrendUpD[1] and iCCID[1]>=LevelD) then
TrendUpD=TrendUpD[1]
endif
endif
if(iCCID<LevelD) then
TrendDownD=high+iATRD
r=255
g=0
if(TrendDownD>TrendDownD[1] and iCCID[1]<=LevelD) then
TrendDownD=TrendDownD[1]
endif
endif
if(TrendDownD[1]<>0.0 and TrendUpD<>0.0) then
SignUpD=TrendUpD
drawtext(“Up Daily”,barindex,signupD,dialog,bold,20) coloured(32,0,194)
endif
if(TrendUpD[1]<>0.0 and TrendDownD<>0.0) then
SignDownD=TrendDownD
drawtext(“DN Daily”,barindex,signdownD,dialog,bold,20) coloured(255,0,0)
endif
timeframe (4 hours)
// — settings
CCIPeriod=50 // CCI indicator period
ATRPeriod=5 // ATR indicator period
Level=0 // CCI activation level
// — end of settings
icci = CCI[CCIPeriod](typicalPrice)
iatr = AverageTrueRange[ATRPeriod](close)
TrendUp=0.0
TrendDown=0.0
SignUp=0.0
SignDown=0.0
if(iCCI>=Level and iCCI[1]<Level) then
TrendUp=TrendDown[1]
endif
if(iCCI<=Level and iCCI[1]>Level) then
TrendDown=TrendUp[1]
endif
if(iCCI>Level) then
TrendUp=low-iATR
r=0
g=255
if(TrendUp<TrendUp[1] and iCCI[1]>=Level) then
TrendUp=TrendUp[1]
endif
endif
if(iCCI<Level) then
TrendDown=high+iATR
r=255
g=0
if(TrendDown>TrendDown[1] and iCCI[1]<=Level) then
TrendDown=TrendDown[1]
endif
endif
if(TrendDown[1]<>0.0 and TrendUp<>0.0) then
SignUp=TrendUp
drawtext(“●”,barindex,signup,dialog,bold,20) coloured(32,0,194)
endif
if(TrendUp[1]<>0.0 and TrendDown<>0.0) then
SignDown=TrendDown
drawtext(“●”,barindex,signdown,dialog,bold,20) coloured(255,0,0)
endif
return