Bonjour Nicolas,
Je cherche à créer un screener avec ton indicateur sémaphore quadratique,mais je cale (trop de paramètres pour moi)
Peux-tu m’aider à faire ressortir les retournements bas (rond rouge) dans un screener.
Merci
//PRC_Quadratic Semaphore | indicator
//25.08.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
length = 30
p=6
// --- end of settings
x1 = barindex
x2 = square(x1)
//upper semaphore
y = high
S11 = summation[length](x2) - square(summation[length](x1))/length
S12 = summation[length](x1*x2) - (summation[length](x1) * summation[length](x2))/length
S22 = summation[length](square(x2)) - square(summation[length](x2))/length
Sy1 = summation[length](y*x1) - (summation[length](y)*summation[length](x1))/length
Sy2 = summation[length](y*x2) - (summation[length](y)*summation[length](x2))/length
max1 = average[length](x1)
max2 = average[length](x2)
may = average[length](y)
b2 = ((Sy1 * S22) - (Sy2*S12))/(S22*S11 - square(S12))
b3 = ((Sy2 * S11) - (Sy1 * S12))/(S22 * S11 - square(S12))
b1 = may - b2*max1 - b3*max2
qr = b1 + b2*x1 + b3*x2
//lower semaphore
yl = low
Sy1l = summation[length](yl*x1) - (summation[length](yl)*summation[length](x1))/length
Sy2l = summation[length](yl*x2) - (summation[length](yl)*summation[length](x2))/length
mayl = average[length](yl)
b2l = ((Sy1l * S22) - (Sy2l*S12))/(S22*S11 - square(S12))
b3l = ((Sy2l * S11) - (Sy1l * S12))/(S22 * S11 - square(S12))
b1l = mayl - b2l*max1 - b3l*max2
qrl = b1l + b2l*x1 + b3l*x2
period = round(p/2)+1
hh = qr[period]
ll = qrl[period]
countH = 0
countL = 0
for i = 1 to period-1 do
if qr[i]<hh then
countH=countH+1
endif
if qrl[i]>ll then
countL=countL+1
endif
next
for i = period+1 to p+1 do
if qr[i]<hh then
countH=countH+1
endif
if qrl[i]>ll then
countL=countL+1
endif
next
atr = averagetruerange[length]
if countH=p then
pivotH = high[period]
drawtext("●",barindex[period],pivotH+atr/2,dialog,bold,20) coloured(25,25,112)
endif
if countL=p then
pivotL = low[period]
drawtext("●",barindex[period],pivotL-atr/2,dialog,bold,20) coloured(176,23,31)
endif
return
J’étais pourtant persuadé d’avoir déjà créé ce screener, mais j’ai rien retrouvé 🙂 Bref, le code ci-dessous détectera les retournements haussiers (point rouge) et baissiers (point bleu).
//PRC_Quadratic Semaphore | indicator
//25.08.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
length = 30
p=6
// --- end of settings
x1 = barindex
x2 = square(x1)
//upper semaphore
y = high
S11 = summation[length](x2) - square(summation[length](x1))/length
S12 = summation[length](x1*x2) - (summation[length](x1) * summation[length](x2))/length
S22 = summation[length](square(x2)) - square(summation[length](x2))/length
Sy1 = summation[length](y*x1) - (summation[length](y)*summation[length](x1))/length
Sy2 = summation[length](y*x2) - (summation[length](y)*summation[length](x2))/length
max1 = average[length](x1)
max2 = average[length](x2)
may = average[length](y)
b2 = ((Sy1 * S22) - (Sy2*S12))/(S22*S11 - square(S12))
b3 = ((Sy2 * S11) - (Sy1 * S12))/(S22 * S11 - square(S12))
b1 = may - b2*max1 - b3*max2
qr = b1 + b2*x1 + b3*x2
//lower semaphore
yl = low
Sy1l = summation[length](yl*x1) - (summation[length](yl)*summation[length](x1))/length
Sy2l = summation[length](yl*x2) - (summation[length](yl)*summation[length](x2))/length
mayl = average[length](yl)
b2l = ((Sy1l * S22) - (Sy2l*S12))/(S22*S11 - square(S12))
b3l = ((Sy2l * S11) - (Sy1l * S12))/(S22 * S11 - square(S12))
b1l = mayl - b2l*max1 - b3l*max2
qrl = b1l + b2l*x1 + b3l*x2
period = round(p/2)+1
hh = qr[period]
ll = qrl[period]
countH = 0
countL = 0
for i = 1 to period-1 do
if qr[i]<hh then
countH=countH+1
endif
if qrl[i]>ll then
countL=countL+1
endif
next
for i = period+1 to p+1 do
if qr[i]<hh then
countH=countH+1
endif
if qrl[i]>ll then
countL=countL+1
endif
next
//atr = averagetruerange[length]
if countH=p then
pivotH = high[period]
//drawtext("●",barindex[period],pivotH+atr/2,dialog,bold,20) coloured(25,25,112)
endif
if countL=p then
pivotL = low[period]
//drawtext("●",barindex[period],pivotL-atr/2,dialog,bold,20) coloured(176,23,31)
endif
blue=pivoth<>pivoth[1]
red=pivotl<>pivotl[1]
screener[blue or red]
Bonjour Nicolas,
Il y’a un décalage de 5 bougies entre les signaux screener et l’indicateur. Je n’arrive pas a aligner tout ça. Est il possible d’avoir de l’aide?
Merci




Tout simplement parce que les signaux de l’indicateur sont tracés dans le passé.