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"
You must be logged in to post a comment.
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.
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