Bonjour,
j’ai tenté de coder le screener suivant qui est un simple croisement de 2 indicateurs (celui en 4h croise celui en daily) dont j’avais demandé l’adaptation pour Prorealtime (merci encore Nicolas).
J’ai l’impression que mon codage n’est pas parfait car certains croisements n’apparaissent pas correctement.
Quelqu’un pourrait il y jeter un oeil et éventuellement apporter les corrections nécessaires (il fonctionne en UT 4heures).
Merci.
//////////////////////////////// Trend Envelopppes
timeframe(Daily)
timePeriodDaily=14
DeviationDaily=0.1
price1Daily=customclose
dsmaDaily = WeightedAverage[timePeriodDaily](price1Daily)
valuesHighDaily = (1 + deviationDaily / 100) * dsmaDaily
valuesLowDaily = (1 - deviationDaily / 100) * dsmaDaily
inputsDaily=price1Daily
if (inputsDaily > valuesHighDaily)then
trendDaily = 1
elsif (inputsDaily < valuesLowDaily) then
trendDaily = -1
endif
if (trendDaily > 0) then
if ( valuesLowDaily < valuesLowDaily[1]) then
valuesLowDaily = valuesLowDaily[1]
endif
if trendDaily[1]>0 then
outputs0Daily = valuesLowDaily
outputs1Daily = valueshighDaily
endif
else
if (valuesHighDaily > valuesHighDaily[1]) then
valuesHighDaily = valuesHighDaily[1]
endif
if trendDaily[1]<0 then
outputs1Daily = valuesHighDaily
outputs0Daily = valueslowDaily
endif
endif
Timeframe (4 hours)
//////////////////////////////// Trend Envelopppes
timePeriod=14
Deviation=0.1
price1=customclose
dsma = WeightedAverage[timePeriod](price1)
valuesHigh = (1 + deviation / 100) * dsma
valuesLow = (1 - deviation / 100) * dsma
inputs=price1
if (inputs > valuesHigh)then
trend = 1
elsif (inputs < valuesLow) then
trend = -1
endif
if (trend > 0) then
if ( valuesLow < valuesLow[1]) then
valuesLow = valuesLow[1]
endif
if trend[1]>0 then
outputs0 = valuesLow
outputs1 = valueshigh
endif
else
if (valuesHigh > valuesHigh[1]) then
valuesHigh = valuesHigh[1]
endif
if trend[1]<0 then
outputs1 = valuesHigh
outputs0 = valueslow
endif
endif
CrossUp = (outputs0 crosses over outputs0Daily)
CrossDn = (outputs1 crosses under Outputs1Daily)
Screener [CrossUp or CrossDn]
Pourrais-tu fournir l’indicateur qui trace ces courbes stp (donc 1 seul indicateur multi timeframe) ? Cela afin de vérifier les valeurs. Merci.
Bonsoir, je ne comprends pas la demande. L’indicateur est disponible dans ma demande. Le rendu est dans le graphique en pièce jointe (paire CHF JPY) prise le 26 septembre à 17h45 environ Time frame 4 heure : une courbe en tracé plein donc en UT 4 heures et une 2ème en tracé en pointillé qui correspond à l’indicateur en daily.
Je les ajoute tous les deux sur une UT 4 heures
//////////////////////////////// Trend Envelopppes
timeframe(Daily,updateonclose)
timePeriod=14
Deviation=0.1
price1=customclose
dsma = WeightedAverage[timePeriod](price1)
valuesHigh = (1 + deviation / 100) * dsma
valuesLow = (1 - deviation / 100) * dsma
inputs=price1
if (inputs > valuesHigh)then
trend = 1
elsif (inputs < valuesLow) then
trend = -1
endif
if (trend > 0) then
alpha1 = 0
if ( valuesLow < valuesLow[1]) then
valuesLow = valuesLow[1]
endif
if trend[1]>0 then
outputs0 = valuesLow
outputs1 = valueshigh
alpha0 = 255
endif
else
alpha0=0
if (valuesHigh > valuesHigh[1]) then
valuesHigh = valuesHigh[1]
endif
if trend[1]<0 then
outputs1 = valuesHigh
outputs0 = valueslow
alpha1 = 255
endif
endif
return outputs0 coloured(65,105,225,alpha0) as "EnvelopUpDaily", outputs1 coloured(255,0,0,alpha1) as "EnvelopdnDaily"
//////////////////////////////// Trend Envelopppes
timePeriod=14
Deviation=0.1
price1=customclose
dsma = WeightedAverage[timePeriod](price1)
valuesHigh = (1 + deviation / 100) * dsma
valuesLow = (1 - deviation / 100) * dsma
inputs=price1
if (inputs > valuesHigh)then
trend = 1
elsif (inputs < valuesLow) then
trend = -1
endif
if (trend > 0) then
alpha1 = 0
if ( valuesLow < valuesLow[1]) then
valuesLow = valuesLow[1]
endif
if trend[1]>0 then
outputs0 = valuesLow
outputs1 = valueshigh
alpha0 = 255
endif
else
alpha0=0
if (valuesHigh > valuesHigh[1]) then
valuesHigh = valuesHigh[1]
endif
if trend[1]<0 then
outputs1 = valuesHigh
outputs0 = valueslow
alpha1 = 255
endif
endif
return outputs0 coloured(65,105,225,alpha0) as "EnvelopUp", outputs1 coloured(255,0,0,alpha1) as "Envelopdn"
Bonsoir,
je me permets de remonter ma demande. Merci.