Nicolas

ATR Volatility Based System Jim Berg

Category: Indicators By: Nicolas Created: March 23, 2020, 10:01 AM
March 23, 2020, 10:01 AM
Indicators
6 Comments
ATR Volatility Based System Jim Berg

In this complete system Jim Berg uses the volatility indicator 2 times the ATR 10 periods by default, for the entry signal as well as the trailing stop.

He also uses it to produce a takeprofit line on the chart (the small violet points) to indicate when prices have moved up suddenly. This can be a signal to take profits before a possible pullback to more normal price movements. The system is set up for long trades only.

//PRC_ATR Volatility Jim Berg | indicator
//23.03.2020
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

// --- settings 
ATRmult = 2 //ATR multiplier 
// --- end of settings 

// ATR trailing stop line 
iATR = averagetruerange[10]
vel1 = Close - ATRmult*iATR
temp = 0
for j = 0 to 14 do 
 temp = Max(temp,vel1[j])
next
vel = temp

// velocity points 
if Close> lowest[20](low) + ATRmult*iATR then 
 trend =  1
 vel3 = average[13,1](high) + ATRmult*iATR
endif

if Close < highest[20](high) - ATRmult*iATR then
 trend = -1
 vel3 = average[13,1](low) - ATRmult*iATR
endif

if trend = 1 then 
 drawcandle(open,high,low,close) coloured(0,255,0)
else
 drawcandle(open,high,low,close) coloured(255,0,0)
endif 

return vel style(line) as "Trailing stop ATR" , vel3 coloured(238,130,238) style(point,3) as "Velocity points" 

 

Download
Filename: PRC_ATR-Volatility-Jim-Berg.itf
Downloads: 353
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

sacram14
4 years ago
#

Merci Nicolas pour ce set-up que je ne connaissais pas ! J'ai tenté de reprendre le code pour en faire un backtest mais j'aurais besoin d'une correction ! J'obtiens de beaux gains mais un taux de réussite faible (<50%), est-ce normal ? ATRmult = 2 //ATR multiplier iATR = averagetruerange[10] ATR2 = ATRmult*iATR IN = close > lowest[20](low) + ATR2 OUT = close < highest[20](high) - ATR2 TP = Average[13,1](high) + ATR2 //ATR Stop suiveur ST = Close - ATR2 temp = 0 for j = 0 to 14 do temp = Max(temp,ST[j]) next STsuiveur = temp // --- Conditions If not longonmarket and IN then buy 1000 cash roundeddown at market //buy 1 shares at market set target profit TP set stop loss STsuiveur endif If LongOnMarket AND OUT THEN SELL AT MARKET ENDIF

mohamed
6 years ago
#

merci Nicolas!

mohamed
6 years ago
#

bonjour nicolas! j'aimerais pouvoir changer les couleurs des chandelier directement depuis la fenêtre de paramètre de l'indicateur au lieux d'entrée a chaque fois dans le code pouvez vous m'aider svp, j'ai essayer de le faire moi même mais je n'est pas réussi, merci d'avance

Nicolas
6 years ago
#

remplacer les valeurs de coloured(0,255,0) par coloured(r,g,b) et ajouter ces noms de variables dans les paramètres de l'indicateur.

bertrandpinoy
6 years ago
#

bonsoir Nicolas est il possible de voir cet indicateur évoluer dans un TF bas pour une aide a la décison sur le scalping? merci.

mlouys
7 years ago
#

Bjr, j ai lu effectivement que le système était long only, mais je crois qu on peut aussi l utiliser a l inverse, je pense l avoir lu sur une autre page ou l on donnait le codage pour différentes plateformes En tout cas encore merci

ProRealCode ProRealCode
Loading...