ProRealCode - Trading & Coding with ProRealTime™
Hello,
J’ai trouvé un indicateur de scalping qui a l’air de plutôt bien fonctionner sur Trading View et je souhaitais savoir si quelqu’un pouvait être en mesure de le traduire en ProBuilder.
L’indicateur s’appelle Scalping PullBack Tool R1.1 par JustUncleL.
En vous souhaitant une très bonne journée !
voici:
//-----------------------------------------------//
//PRC_Scalping PullBack Tool by JustUncleL
//version = 0
//16.09.25
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//-----------------------------------------------//
HiLoLen = 34 //High Low PAC channel Length
fastEMAlength = 89 //
mediumEMAlength = 200 //
slowEMAlength = 600 //
ShowFastEMA = 1 //
ShowMediumEMA = 1 //
ShowSlowEMA = 0 //
ShowHHLL = 0 //
ShowFractals = 0 //
filterBW = 0 //Show Ideal Fractals Only
ShowBarColor = 0 //Show coloured Bars around PAC
ShowTrendBGcolor= 1 //
UseHAcandles = 1 //Use Heikin Ashi Candles in Algo Calculations
atr=averagetruerange[14](close)
//-----------------------------------------------//
// Candles Definition
//-----------------------------------------------//
once haopen=open
if UseHAcandles then
haclose=(open+close+high+low)/4
if barindex> 0 then
haopen=(haopen+haclose[1])/2
endif
halow=min(low,min(haclose,haopen))
hahigh=max(high,max(haclose,haopen))
else
haclose=close
haopen=open
halow=low
hahigh=high
endif
//-----------------------------------------------//
// Setup Moving averages and PAC channel
//-----------------------------------------------//
fastEma = average[fastEMAlength,1](haclose)
mediumEma = average[mediumEMAlength,1](haclose)
slowEma = average[slowEMAlength,1](haclose)
pacC = average[hiLoLen,1](haclose)
pacL = average[hiLoLen,1](halow)
pacU = average[hiLoLen,1](hahigh)
if fastEma>mediumEma and pacL > mediumEma then
trendDirection = 1
elsif fastEma<mediumEma and pacU<mediumEma then
trendDirection = -1
else
trendDirection = 0
endif
//-----------------------------------------------//
// Fractal recognition
//-----------------------------------------------//
if filterBW then
filteredtopf=high[4] <high[3] and high[3] <high[2] and high[2] >high[1] and high[1] >high
filteredbotf=low[4] >low[3] and low[3] >low[2] and low[2] <low[1] and low[1] <low
else
filteredtopf=high[4] <high[2] and high[3] <=high[2] and high[2] >=high[1] and high[2] >high
filteredbotf=low[4] >low[2] and low[3] >=low[2] and low[2] <=low[1] and low[2] <low
endif
//-----------------------------------------------//
// Higher Highs, Lower Highs, Higher Lows and Lower Lows
//-----------------------------------------------//
if filteredtopf then
valuewhenH2 = valuewhenH1
valuewhenH1 = valuewhenH0
valuewhenH0 = high[2]
higherhigh=valuewhenH1 < valuewhenH0 and valuewhenH2 < valuewhenH0
lowerhigh=valuewhenH1 > valuewhenH0 and valuewhenH2 > valuewhenH0
drawtext("▼",barindex[2],high[2]+atr*0.35)coloured("red",255*showFractals)
else
higherhigh=0
lowerhigh=0
endif
if filteredbotf then
valuewhenL2 = valuewhenL1
valuewhenL1 = valuewhenL0
valuewhenL0 = low[2]
higherlow=valuewhenL1 < valuewhenL0 and valuewhenL2 < valuewhenL0
lowerlow=valuewhenL1 > valuewhenL0 and valuewhenL2 > valuewhenL0
drawtext("▲",barindex[2],low[2]-atr*0.35)coloured("green",255*showFractals)
else
higherlow=0
lowerlow=0
endif
//-----------------------------------------------//
// Plotting
//-----------------------------------------------//
// Price Action Channel
colorbetween(pacL,pacU,"grey",90)
// Colour bars
if haClose>pacU then
r=0
g=0
b=255
elsif haClose<pacL then
r=255
g=0
b=0
else
r=124
g=124
b=124
endif
drawcandle(haopen,hahigh,halow,haclose)coloured(r,g,b,ShowBarColor*255)
// Background color
if trendDirection=1 then
backgroundcolor("green",30*ShowTrendBGcolor)
elsif trendDirection=-1 then
backgroundcolor("red",30*ShowTrendBGcolor)
else
backgroundcolor("yellow",30*ShowTrendBGcolor)
endif
// show HHLL
if showHHLL then
if higherhigh then
drawtext("HH",barindex[2],high[2]+atr)coloured("darkred")
endif
if lowerhigh then
drawtext("LH",barindex[2],high[2]+atr)coloured("darkred")
endif
if higherlow then
drawtext("HL",barindex[2],low[2]-atr)coloured("darkgreen")
endif
if lowerlow then
drawtext("LL",barindex[2],low[2]-atr)coloured("darkgreen")
endif
endif
//-----------------------------------------------//
return pacL as "High PAC ema" coloured("grey")style(line,1), pacU as "Low PAC ema" coloured("grey")style(line,1),pacC as "Close PAC ema" coloured("red")style(line,2), fastEMA as "fast Ema"coloured("green",showFastEma*255)style(line,2),mediumEMA as "medium Ema"coloured("blue",showMediumEma*255)style(line,3),slowEMA as "slow Ema"coloured("black",showSlowEma*255)style(line,4)
Merci, c’est très gentil.
J’ai l’impression qu’il y a un problème le code ne s’exécute pas , sûrement à cause d’un “endif” oublié.
Est ce possible de le corriger ?
En vous souhaitant une très bonne journée
Bonjour, l’indicateur fonctionne correctement. J’ai copié et collé le code dans un nouvel indicateur et il n’y a aucun problème.
Quelle est exactement l’erreur que ça t’affiche ?
J’ai essayé de le recopier et le problème semble résolu.
En revange, je ne vois pas les fractales (triangles sur l’indicateur) savez-vous pourquoi ?
Il faut le définir dans les premières lignes, mettre 1 (vrai) pour afficher ou 0 (faux) pour masquer.
Scalping PullBack Tool
This topic contains 5 replies,
has 2 voices, and was last updated by
Iván González
4 months, 2 weeks ago.
| Forum: | ProBuilder : Indicateurs & Outils Personnalisés |
| Language: | French |
| Started: | 09/14/2025 |
| Status: | Active |
| Attachments: | No files |
The information collected on this form is stored in a computer file by ProRealCode to create and access your ProRealCode profile. This data is kept in a secure database for the duration of the member's membership. They will be kept as long as you use our services and will be automatically deleted after 3 years of inactivity. Your personal data is used to create your private profile on ProRealCode. This data is maintained by SAS ProRealCode, 407 rue Freycinet, 59151 Arleux, France. If you subscribe to our newsletters, your email address is provided to our service provider "MailChimp" located in the United States, with whom we have signed a confidentiality agreement. This company is also compliant with the EU/Swiss Privacy Shield, and the GDPR. For any request for correction or deletion concerning your data, you can directly contact the ProRealCode team by email at privacy@prorealcode.com If you would like to lodge a complaint regarding the use of your personal data, you can contact your data protection supervisory authority.