CONVERTIR UN INDICATEUR TRADINGVIEW
Forums › ProRealTime forum Français › Support ProBuilder › CONVERTIR UN INDICATEUR TRADINGVIEW
-
-
03/27/2025 at 7:37 PM #245364
Bonsoir, ci joint un indicateur de chez tradingview à convertir sur Prorealtime.
indicator(title=’RAM BUY AND SELL SIGNALS’, overlay=true)
// Inputs
a = input.int(1, title=’Key Value. \”This changes the sensitivity\”‘)
c = input.int(10, title=’ATR Period’)
h = input.bool(false, title=’Signals from Heikin Ashi Candles’)
xATR = ta.atr(c)
nLoss = a * xATR
src = h ? request.security(syminfo.tickerid, timeframe.period, close, lookahead=barmerge.lookahead_off, gaps=barmerge.gaps_off) : close
xATRTrailingStop = 0.0
iff_1 = src > nz(xATRTrailingStop[1], 0) ? src – nLoss : src + nLoss
iff_2 = src < nz(xATRTrailingStop[1], 0) and src[1] < nz(xATRTrailingStop[1], 0) ? math.min(nz(xATRTrailingStop[1]), src + nLoss) : iff_1
xATRTrailingStop := src > nz(xATRTrailingStop[1], 0) and src[1] > nz(xATRTrailingStop[1], 0) ? math.max(nz(xATRTrailingStop[1]), src – nLoss) : iff_2
pos = 0
iff_3 = src[1] > nz(xATRTrailingStop[1], 0) and src < nz(xATRTrailingStop[1], 0) ? -1 : nz(pos[1], 0)
pos := src[1] < nz(xATRTrailingStop[1], 0) and src > nz(xATRTrailingStop[1], 0) ? 1 : iff_3
xcolor = pos == -1 ? color.red : pos == 1 ? color.green : color.blue
ema = ta.ema(src, 1)
above = ta.crossover(ema, xATRTrailingStop)
below = ta.crossover(xATRTrailingStop, ema)
buy = src > xATRTrailingStop and above
sell = src < xATRTrailingStop and below
barbuy = src > xATRTrailingStop
barsell = src < xATRTrailingStop
plotshape(buy, title=’Buy’, text=’Buy’, style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.new(color.white, 0), size=size.tiny)
plotshape(sell, title=’Sell’, text=’Sell’, style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.white, 0), size=size.tiny)
barcolor(barbuy ? color.green : na)
barcolor(barsell ? color.red : na)
alertcondition(buy, ‘BUY’, ‘BUY’)
alertcondition(sell, ‘SELL’, ‘SELL’)
03/28/2025 at 10:56 AM #245383123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990//-------------------------------------------////-------------------------------------------//// Inputs//-------------------------------------------//a=1 //Sensivityc=10 //atr periodheikin=0 //Signals from Heikin Ashi candles//-------------------------------------------//// Calculations//-------------------------------------------//xatr=averagetruerange[c](close)nLoss=a*xatrif heikin thenelsesrc=closeendifxatrTrailingstop=0if src>xatrTrailingstop[1] theniff1=src-nLosselseiff1=src+nLossendifif src<xatrTrailingstop[1] and src[1]<xatrTrailingstop[1] theniff2=min(xatrTrailingstop[1],src+nLoss)elseiff2=iff1endifif src>xatrTrailingstop[1] and src[1]>xatrTrailingstop[1] thenxatrTrailingstop=max(xatrTrailingstop[1],src-nLoss)elsexatrTrailingstop=iff2endifpos=0if src[1]>xatrTrailingstop[1] and src<xatrTrailingstop[1] theniff3=-1elseiff3=pos[1]endifif src[1]<xatrTrailingstop[1] and src>xatrTrailingstop[1] thenpos=1elsepos=iff3endifif pos=-1 thenr=255g=0b=0elsif pos=1 thenr=0g=255b=0elser=0g=0b=255endifema=average[1,1](src)above=ema crosses over xatrTrailingstopbelow=ema crosses under xatrTrailingstopibuy=src>xatrTrailingstop and aboveisell=src<xatrTrailingstop and belowbarbuy=src>xatrTrailingstopbarsell=src<xatrTrailingstopif ibuy thendrawarrowup(barindex,low-xatr)coloured("green")elsif isell thendrawarrowdown(barindex,high+xatr)coloured("red")endifif barbuy thendrawcandle(open,high,low,close)coloured("green")elsif barsell thendrawcandle(open,high,low,close)coloured("red")endif//-------------------------------------------//return03/29/2025 at 4:13 PM #245407Salut Ivan,
tu as oublié d’ajouter le code pour les bougies Heikin…An other Ut Bot Alert ?1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495//-------------------------------------------////-------------------------------------------//// Inputs//-------------------------------------------////a=1 //Sensivity//c=10 //atr period//heikin=1 //Signals from Heikin Ashi candles//-------------------------------------------//// Calculations//-------------------------------------------//xatr=averagetruerange[c](close)nLoss=a*xatrif heikin thenoffset = 1-(BarIndex=0)XOpen = (XOpen[offset] + Xclose[offset]) / 2XClose = TotalPriceXHigh = highXLow = Lowsrc = XCloseelsesrc = closeendifxatrTrailingstop=0if src>xatrTrailingstop[1] theniff1=src-nLosselseiff1=src+nLossendifif src<xatrTrailingstop[1] and src[1]<xatrTrailingstop[1] theniff2=min(xatrTrailingstop[1],src+nLoss)elseiff2=iff1endifif src>xatrTrailingstop[1] and src[1]>xatrTrailingstop[1] thenxatrTrailingstop=max(xatrTrailingstop[1],src-nLoss)elsexatrTrailingstop=iff2endifpos=0if src[1]>xatrTrailingstop[1] and src<xatrTrailingstop[1] theniff3=-1elseiff3=pos[1]endifif src[1]<xatrTrailingstop[1] and src>xatrTrailingstop[1] thenpos=1elsepos=iff3endifif pos=-1 thenr=255g=0b=0elsif pos=1 thenr=0g=255b=0elser=0g=0b=255endifema=average[1,1](src)above=ema crosses over xatrTrailingstopbelow=ema crosses under xatrTrailingstopibuy=src>xatrTrailingstop and aboveisell=src<xatrTrailingstop and belowbarbuy=src>xatrTrailingstopbarsell=src<xatrTrailingstopif ibuy thendrawarrowup(barindex,low-xatr)coloured("green")elsif isell thendrawarrowdown(barindex,high+xatr)coloured("red")endifif barbuy thendrawcandle(open,high,low,close)coloured("green")elsif barsell thendrawcandle(open,high,low,close)coloured("red")endif//-------------------------------------------//return -
AuthorPosts
Find exclusive trading pro-tools on