Merci pour ta réponse Nicolas
Voici le code en question: Il n’a pas l’air de fonctionner sur la V11
//PRC_AnotherRSIdivergences | indicator
//25.02.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
RSIp=14 //RSI period
obLevel=70 //overbought level
osLevel=30 //oversold level
minimalBars=5 //minimal count of bars where RSI is ob or os
minBarBetween = 4
maxBarBetween = 16
noLowerThan = 60
noHigherThan = 40
// --- end of settings
irsi = rsi[RSIp]
ob = irsi>obLevel
os = irsi<osLevel
if ob then
if not ob[1] then
maxrsi = 0
maxprice = 0
firstobbar = barindex
endif
maxrsi=max(maxrsi,irsi)
maxprice=max(maxprice,high)
if maxrsi<>maxrsi[1] then
maxrsibar=barindex
endif
endif
if os then
if not os[1] then
minrsi = 100
minprice = close*100
firstosbar = barindex
endif
minrsi=min(minrsi,irsi)
minprice=min(minprice,low)
if minrsi<>minrsi[1] then
minrsibar=barindex
endif
endif
divsell=0
if irsi crosses under obLevel then
//verif divergence
barcount=maxrsibar-oldmaxrsibar
div = maxprice>oldmaxprice and maxrsi<oldmaxrsi and (barindex-firstobbar)>=minimalBars and barcount>=minbarbetween and barcount<=maxbarbetween and summation[max(1,barcount)](irsi<noLowerThan)=0
if div then
//drawsegment(oldmaxrsibar,oldmaxrsi,maxrsibar,maxrsi) coloured(200,0,0)
//drawarrowdown(maxrsibar,maxrsi) coloured(200,0,0)
divsell=osLevel
endif
oldmaxrsi = maxrsi
oldmaxprice = maxprice
oldmaxrsibar = maxrsibar
endif
divbuy=0
if irsi crosses over osLevel then
//verif divergence
barcount=minrsibar-oldminrsibar
div = minprice<oldminprice and minrsi>oldminrsi and (barindex-firstosbar)>=minimalBars and barcount>=minbarbetween and barcount<=maxbarbetween and summation[max(1,barcount)](irsi>noHigherThan)=0
if div then
//drawsegment(oldminrsibar,oldminrsi,minrsibar,minrsi) coloured(0,200,0)
//drawarrowup(minrsibar,minrsi) coloured(0,200,0)
divbuy=osLevel
endif
oldminrsi = minrsi
oldminprice = minprice
oldminrsibar = minrsibar
endif
screener[divbuy or divsell](max(divbuy,divsell))
De plus te serait-il également possible de regarder cet indicateur (même code)
Lui aussi ne marche pas super sur la V11
//PRC_AnotherRSIdivergences | indicator
//25.02.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
RSIp=14 //RSI period
obLevel=70 //overbought level
osLevel=30 //oversold level
minimalBars=5 //minimal count of bars where RSI is ob or os
minBarBetween = 4
maxBarBetween = 16
noLowerThan = 60
noHigherThan = 40
// --- end of settings
irsi = rsi[RSIp]
ob = irsi>obLevel
os = irsi<osLevel
if ob then
if not ob[1] then
maxrsi = 0
maxprice = 0
firstobbar = barindex
endif
maxrsi=max(maxrsi,irsi)
maxprice=max(maxprice,high)
if maxrsi<>maxrsi[1] then
maxrsibar=barindex
endif
endif
if os then
if not os[1] then
minrsi = 100
minprice = close*100
firstosbar = barindex
endif
minrsi=min(minrsi,irsi)
minprice=min(minprice,low)
if minrsi<>minrsi[1] then
minrsibar=barindex
endif
endif
divsell=0
if irsi crosses under obLevel then
//verif divergence
barcount=minrsibar-oldminrsibar
div = maxprice>oldmaxprice and maxrsi<oldmaxrsi and (barindex-firstobbar)>=minimalBars and barcount>=minbarbetween and barcount<=maxbarbetween and summation[max(1,barcount)](irsi<noLowerThan)=0
if div then
drawsegment(oldmaxrsibar,oldmaxrsi,maxrsibar,maxrsi) coloured(200,0,0)
drawarrowdown(maxrsibar,maxrsi) coloured(200,0,0)
divsell=osLevel
endif
oldmaxrsi = maxrsi
oldmaxprice = maxprice
oldmaxrsibar = maxrsibar
endif
divbuy=0
if irsi crosses over osLevel then
//verif divergence
barcount=minrsibar-oldminrsibar
div = minprice<oldminprice and minrsi>oldminrsi and (barindex-firstosbar)>=minimalBars and barcount>=minbarbetween and barcount<=maxbarbetween and summation[max(1,barcount)](irsi>noHigherThan)=0
if div then
drawsegment(oldminrsibar,oldminrsi,minrsibar,minrsi) coloured(0,200,0)
drawarrowup(minrsibar,minrsi) coloured(0,200,0)
divbuy=osLevel
endif
oldminrsi = minrsi
oldminprice = minprice
oldminrsibar = minrsibar
endif
return irsi style(line,2) as "RSI",obLevel coloured(168,168,168) style(dottedline,1) as "overbought level", osLevel coloured(168,168,168) style(dottedline,1) as "oversold level", divsell coloured(200,0,0) style(histogram) as "sell divergence", divbuy coloured(0,200,0) style(histogram) as "buy divergence"
Merci beaucoup pour ton aide