Demande d’information sur l’indicateur HYPERTREND
Forums › ProRealTime forum Français › Support ProScreener › Demande d’information sur l’indicateur HYPERTREND
- This topic has 10 replies, 3 voices, and was last updated 4 weeks ago by
robertogozzi.
-
-
10/17/2024 at 7:04 PM #239308
Bonjour a tous la communauté,
je suis entrain de tester l’indicateur HYPERTREND et je voudrais afficher mes actions quand l’indicateur est en ligne verte ( tendance haussière ) et quand l’indicateur est en ligne rouge ( tendance baissière)
pouvez vous m’aidez a coder ce code svp
merci beaucoup
ci dessous le code source du code de l’indicateur :
//PRC_Q-Trend | indicator
//17.07.23
//Nicolas @ http://www.prorealcode.com
//Sharing ProRealTime knowledge// —settings
//p = 200 //Trend period
//atrp = 14 //ATR Period
//mult = 1.0 //ATR Multiplier
//mode = 1 //Signal mode options = [1=”Type A”, 2=”Type B”]
//useemasmoother = 0 //Smooth source with EMA? 0=false ; 1=true
//srcemaperiod = 3 //EMA Smoother period
//colorbars = 0 //Color bars? 0=false ; 1=true
//signalsview = 0 //0 = trend inversion ; 1 = strong buy / strong sell only
// — end of settingssource = customclose
// Calculations
if useemasmoother then
src = average[srcemaperiod,1](source)
else
src=source
endifhh = highest[p](src) // Highest of src p-bars back;
ll = lowest[p](src) // Lowest of src p-bars back.
d = hh – llif barindex>p then
once m = (hh + ll) / 2 // Initial trend line;
atr = AverageTrueRange[atrp][1] // ATR;
epsilon = mult * atr // Epsilon is a mathematical variable used in many different theorems in order to simplify work with mathematical object. Here it used as sensitivity measure.if mode=2 then //type B
changeup = src crosses over m+epsilon or src crosses under m+epsilon
changedown = src crosses over m-epsilon or src crosses under m-epsilon
else
changeup = src crosses over m+epsilon or src > m+epsilon
changedown = src crosses under m-epsilon or src < m-epsilon
endifsb = open < ll + d / 8 and open >= ll
ss = open > hh – d / 8 and open <= hh
strongbuy = sb or sb[1] or sb[2] or sb[3] or sb[4]
strongsell = ss or ss[1] or ss[2] or ss[3] or ss[4]if (changeup or changedown) then
if changeup then
m=m + epsilon
elsif changedown then
m=m – epsilon
endif
else
m=m[1]
endifif changeup then
r=0
g=255
elsif changedown then
r=255
g=0
endifif colorbars then
drawcandle(open,high,low,close)coloured(r,g,0)
endifif signalsview=1 then
if strongbuy and ls<>1 then
drawtext(“▲”,barindex,low) coloured(“lime”)
ls=1
endif
if strongsell and ls<>-1 then
drawtext(“▼”,barindex,high) coloured(“red”)
ls=-1
endif
else
if r<>r[1]and r>0 then
drawtext(“▼”,barindex[1],m[1]) coloured(“red”)
endif
if r<>r[1]and r=0 then
drawtext(“▲”,barindex[1],m[1]) coloured(“lime”)
endif
endif
endifRETURN m style(line,3) coloured(r,g,0)
10/17/2024 at 7:04 PM #239164Bonjour a tous les codeurs
j’espère que tous ce passe à merveille pour vous =)
j’ai un petit souci, j’utilise actuellement l’indicateur hypertrend et je souhaiterais afficher plusieurs conditions ,
pour les achats ;
1 ) début de la barre verte de l’hypertrend
2) close en dessous de la barre verte de l’hypertrend
Pour les ventes,
1) début de la barre rouge de l’hypertrend
2) close au dessus de la barre rouge de l’hypertrend
Si vous pouvez m’aider sur ces 4 variables a coder sa serait sympas =)
je vous mets le code sources de l’indicateur ci dessous
merci beaucoup pour votre aide
code source de l’indicateurs :
once avg = close
once hold = 0
once os = 1
once rR = 220
once gR = 20
once bR = 60
once rV = 60
once gV = 179
once bV = 113if barindex > 200 then
atr = AverageTrueRange[200] * multIf abs(close – avg) > atr then
avg = (close+avg)/2
//avg = avgN
else
avg = avg + os*(hold/mult/slope)
//avg = avgN
endifos = sgn(avg – avg[1])
If os <> os[1] then
hold = atr
else
hold = hold[1]
endifupper = avg + width*hold/100
lower = avg – width*hold/100If os = 1 then
r = rV
g = gV
b = bV
else
r = rR
g = gR
b = bR
endifDRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)
DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)
DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)
ColorBetween(avg,upper,rR,gR,bR,30)
ColorBetween(avg,lower,rV,gV,bV,30)endif
Return
10/18/2024 at 10:38 AM #239180Buenas. J'espère avoir entendu ce que je cherchais…
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960mult=5slope=14width=80once avg = closeonce hold = 0once os = 1once rR = 220once gR = 20once bR = 60once rV = 60once gV = 179once bV = 113if barindex > 200 thenatr = AverageTrueRange[200] * multIf abs(close - avg) > atr thenavg = (close+avg)/2//avg = avgNelseavg = avg + os*(hold/mult/slope)//avg = avgNendifos = sgn(avg - avg[1])If os <> os[1] thenhold = atrelsehold = hold[1]endifupper = avg + width*hold/100lower = avg - width*hold/100If os = 1 thenif os<>os[1] thendrawarrowup(barindex,low)coloured("green")endifr = rVg = gVb = bVelseif os<>os[1] thendrawarrowdown(barindex,high)coloured("red")endifr = rRg = gRb = bRendifDRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)ColorBetween(avg,upper,rR,gR,bR,30)ColorBetween(avg,lower,rV,gV,bV,30)endifReturnSi ce n’est pas le cas, marquez sur un graphique ce que vous souhaitez automatiser.
1 user thanked author for this post.
10/19/2024 at 9:55 AM #239240merci beaucoup pour votre retour cela est très utile pour le code =)
mais comment fait ont pour faire un screen avec une seule conditions à la fois ,
c’est a dire d’abord faire un screen avec seulement la conditions 1 pour les achats , ensuite faire un autre screen seulement avec la conditions 2 pour les achats , et par la suite la même chose pour les ventes.
merci beaucoup pour votre retour et bonne journée a vous =)
10/22/2024 at 12:07 PM #239328Bonjour,
Pour réaliser un screen avec une seule condition à la fois, voici comment procéder :
Pour les achats : Début de la barre verte de l’Hypertrend.
Vous pouvez créer le screener ainsi :123456if os = 1 and os <> os[1] thenconditionLong = 1elseconditionLong = 0endifscreener[conditionLong]Pour les ventes : Début de la barre rouge de l’Hypertrend.
Voici le code pour cette condition :123456if os = -1 and os <> os[1] thenconditionShort = 1elseconditionShort = 0endifscreener[conditionShort]10/23/2024 at 4:53 PM #2393761234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768//17.07.23//Nicolas @ http://www.prorealcode.com//Sharing ProRealTime knowledge// —settingsp = 200 //Trend periodatrp = 14 //ATR Periodmult = 1.0 //ATR Multipliermode = 1 //Signal mode options = [1="Type A", 2="Type B"]useemasmoother = 0 //Smooth source with EMA? 0=false ; 1=truesrcemaperiod = 3 //EMA Smoother period// — end of settingssource = customclose// Calculationsif useemasmoother thensrc = average[srcemaperiod,1](source)elsesrc=sourceendifhh = highest[p](src) // Highest of src p-bars back;ll = lowest[p](src) // Lowest of src p-bars back.if barindex>p thenonce m = (hh + ll) / 2 // Initial trend line;atr = AverageTrueRange[atrp][1] // ATR;epsilon = mult * atr // Epsilon is a mathematical variable used in many different theorems in order to simplify work with mathematical object. Here it used as sensitivity measure.if mode=2 then //type Bchangeup = src crosses over m+epsilon or src crosses under m+epsilonchangedown = src crosses over m-epsilon or src crosses under m-epsilonelsechangeup = src crosses over m+epsilon or src > m+epsilonchangedown = src crosses under m-epsilon or src < m-epsilonendifif (changeup or changedown) thenif changeup thenm=m + epsilonelsif changedown thenm=m - epsilonendifelsem=m[1]endifif changeup thenr=0elsif changedown thenr=255endifif r<>r[1]and r>0 thenshort=1elseshort=0endifif r<>r[1]and r=0 thenlong=1elselong=0endifendifscreener[long or short](long as "Long", short as "Short")Ici tu as :
1 user thanked author for this post.
10/23/2024 at 7:26 PM #239381merci beaucoup pour votre retour ,
mais pouvez vous m’aidez a coder une conditions à la fois svp
c’est a dire indiquer le code seulement a effectuer pour les achats et ensuite indiquer le code pour les ventes
merci beaucoup de votre aide
02/23/2025 at 3:57 PM #244233Bonjour a tous la communauté =)
je suis entrain de tester l’indicateur HYPERTREND,
pouvez vous m’aider a coder un proscreener lorsque la tendance est verte et que le prix est en dessous de la barre verte svp ( ci joint une prise écran )
merci à tous de votre aide
ci dessous le code source de l’indicateur
hypertrend12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152once avg = closeonce hold = 0once os = 1once rR = 220once gR = 20once bR = 60once rV = 60once gV = 179once bV = 113if barindex > 200 thenatr = AverageTrueRange[200] * multIf abs(close - avg) > atr thenavg = (close+avg)/2//avg = avgNelseavg = avg + os*(hold/mult/slope)//avg = avgNendifos = sgn(avg - avg[1])If os <> os[1] thenhold = atrelsehold = hold[1]endifupper = avg + width*hold/100lower = avg - width*hold/100If os = 1 thenr = rVg = gVb = bVelser = rRg = gRb = bRendifDRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)ColorBetween(avg,upper,rR,gR,bR,30)ColorBetween(avg,lower,rV,gV,bV,30)endifReturn02/24/2025 at 3:32 PM #244289Voici le code (je joins également le fichier ITF) :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960once mult = 5once slope= 14//once width= 80once avg = closeonce hold = 0once os = 1//once rR = 220//once gR = 20//once bR = 60//once rV = 60//once gV = 179//once bV = 113Flag = 0if barindex > 200 thenatr = AverageTrueRange[200] * multIf abs(close - avg) > atr thenavg = (close+avg)/2//avg = avgNelseavg = avg + os*(hold/mult/slope)//avg = avgNendifos = sgn(avg - avg[1])If os <> os[1] thenhold = atrelsehold = hold[1]endif//upper = avg + width*hold/100//lower = avg - width*hold/100If os = 1 then//r = rV//g = gV//b = bVFlag = 1else//r = rR//g = gR//b = bRFlag = 2endif//DRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)//DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)//DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)//ColorBetween(avg,upper,rR,gR,bR,30)//ColorBetween(avg,lower,rV,gV,bV,30)endifSignal = 0IF (Flag = 1) and (close < avg) THENSignal = 1endifSCREENER[Signal AND (high <> low)]2 users thanked author for this post.
02/24/2025 at 7:40 PM #244311Bonjour robertogozzi
merci beaucoup de vote retour, par la même occasions
pouvez vous m’aider a coder un proscreener lorsque la tendance est rouge et que le prix est au dessus de la barre rouge svp ( ci joint une prise écran )
cordialement
02/24/2025 at 11:15 PM #244320Voilà:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960once mult = 5once slope= 14//once width= 80once avg = closeonce hold = 0once os = 1//once rR = 220//once gR = 20//once bR = 60//once rV = 60//once gV = 179//once bV = 113Flag = 0if barindex > 200 thenatr = AverageTrueRange[200] * multIf abs(close - avg) > atr thenavg = (close+avg)/2//avg = avgNelseavg = avg + os*(hold/mult/slope)//avg = avgNendifos = sgn(avg - avg[1])If os <> os[1] thenhold = atrelsehold = hold[1]endif//upper = avg + width*hold/100//lower = avg - width*hold/100If os = 1 then//r = rV//g = gV//b = bVFlag = 1else//r = rR//g = gR//b = bRFlag = 2endif//DRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)//DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)//DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)//ColorBetween(avg,upper,rR,gR,bR,30)//ColorBetween(avg,lower,rV,gV,bV,30)endifSignal = 0IF (Flag = 2) and (close > avg) THENSignal = 2endifSCREENER[Signal AND (high <> low)] -
AuthorPosts
Find exclusive trading pro-tools on