DownloadRe: Already Converted TradingView Indicators to MT4 Indicators

291
//@version=4
// gkjch
// Original By: JustUncleL : https://www.tradingview.com/script/Ja29 ... ustUncleL/

study(title="Simple Pivots", shorttitle="Pivots", overlay=true, max_bars_back=50)

ShowPivots = input(true, title="Show Pivot Lines")

left = input(8, minval=1, title="Pivot Lookback Left Hand Side")
right = input(8, minval=1, title="Pivot lookback Right Hand Side")

ExtendCurrentPivots = input(defval = true, title = "Draw lines extending from most recent pivots forward")
ShowPivotPrice = input(defval = false, title = "Place price of prior pivots on chart")

Shunt = input(1, minval=0, maxval=1, type=input.integer, title="When to start Printing Pivot (0 = no wait, 1 = wait for candle close)")
maxLvlLen = input(0, minval=0, title="Maximum Level Extension Length - 0 indicates no maximum")


// Get High and Low Pivot Points
pvthi_ = pivothigh(high, left, right)
pvtlo_ = pivotlow(low, left, right)

// Force Pivot completion before plotting.
pvthi = pvthi_[Shunt]
pvtlo = pvtlo_[Shunt]

//Count How many candles for current Pivot Level, If new reset.
counthi = 0
countlo = 0
counthi := na(pvthi) ? nz(counthi[1]) + 1 : 0
countlo := na(pvtlo) ? nz(countlo[1]) + 1 : 0

pvthis = 0.0
pvtlos = 0.0
pvthis := na(pvthi) ? pvthis[1] : high[right + Shunt]
pvtlos := na(pvtlo) ? pvtlos[1] : low[right + Shunt]

// Colors for Lines
hipc = pvthis != pvthis[1] ? na : color.green
lopc = pvtlos != pvtlos[1] ? na : color.red

// Draw historical levels, "line" objects are limited in history.
plot(ShowPivots and (maxLvlLen == 0 or counthi < maxLvlLen) ? pvthis : na, color=hipc, linewidth=1, offset=-right - Shunt, title="Top Levels")
plot(ShowPivots and (maxLvlLen == 0 or countlo < maxLvlLen) ? pvtlos : na, color=lopc, linewidth=1, offset=-right - Shunt, title="Bottom Levels")

drawLabel(_offset, _pivot, _style, _yloc, _color, _text, _size) =>
if not na(_pivot)
label.new(bar_index[_offset], _pivot, text = _text+tostring(_pivot, format.mintick)+"]", style=_style, yloc=_yloc, color=_color, textcolor=_color, size = _size)

drawLabel(right+Shunt, ShowPivotPrice and counthi < counthi[1] and pvthis != pvthis[1] ? pvthis : na, label.style_none, yloc.abovebar, color.green, "[", size.normal)
drawLabel(right+Shunt, ShowPivotPrice and countlo < countlo[1] and pvtlos != pvtlos[1] ? pvtlos : na, label.style_none, yloc.belowbar, color.red, "[", size.normal)

LineFunction(ShowLine, startLine, stopLine, levelLine, colorLine, lineStyle, lineWidth, lastLine) =>
line.delete(lastLine)
ShowLine?
line.new(
x1 = startLine,
x2 = stopLine,
y1 = levelLine,
y2 = levelLine,
xloc = xloc.bar_index,
extend = extend.right,
color = colorLine,
style = lineStyle,
width = lineWidth): na

var line HiPivot = na
var line LoPivot = na
HiPivot := LineFunction(ExtendCurrentPivots, counthi > counthi[1] ? bar_index-right-Shunt : na, bar_index, pvthis, color.green, close > pvthis ? line.style_solid : line.style_dotted, 1, HiPivot[1])
LoPivot := LineFunction(ExtendCurrentPivots, countlo > countlo[1] ? bar_index-right-Shunt : na, bar_index, pvtlos, color.red, close < pvtlos ? line.style_solid : line.style_dotted, 1, LoPivot[1])



Can masters adapt this pivot indicator mt4?
Attachments


Re: Already Converted TradingView Indicators to MT4 Indicators

292
;) HI, masters! Is it possible to convert this indicator to MT4?
Linear Regression Candles
//@version=4
study(title="Humble LinReg Candles", shorttitle="LinReg Candles", format=format.price, precision=4, overlay=true)

signal_length = input(title="Signal Smoothing", type=input.integer, minval = 1, maxval = 200, defval = 11)
sma_signal = input(title="Simple MA (Signal Line)", type=input.bool, defval=true)

lin_reg = input(title="Lin Reg", type=input.bool, defval=true)
linreg_length = input(title="Linear Regression Length", type=input.integer, minval = 1, maxval = 200, defval = 11)

bopen = lin_reg ? linreg(open, linreg_length, 0) : open
bhigh = lin_reg ? linreg(high, linreg_length, 0) : high
blow = lin_reg ? linreg(low, linreg_length, 0) : low
bclose = lin_reg ? linreg(close, linreg_length, 0) : close

r = bopen < bclose

signal = sma_signal ? sma(bclose, signal_length) : ema(bclose, signal_length)

plotcandle(r ? bopen : na, r ? bhigh : na, r ? blow: na, r ? bclose : na, title="LinReg Candles", color= color.green, wickcolor=color.green, bordercolor=color.green, editable= true)
plotcandle(r ? na : bopen, r ? na : bhigh, r ? na : blow, r ? na : bclose, title="LinReg Candles", color=color.red, wickcolor=color.red, bordercolor=color.red, editable= true)

plot(signal, color=color.white)
Attachments
Who knows others is wise
Who knows himself is enlightened

Re: Already Converted TradingView Indicators to MT4 Indicators

293
;) HI, masters! Is it possible to convert this indicator to MT4?
Bollinger Bands Scalper + VWAP

//@version=5
indicator(shorttitle="bbs", title="Bollinger Bands Scalper + VWAP", overlay=true, timeframe="", timeframe_gaps=true)

//trendicator

length = input.int(20, minval=1, title='Trendicator Length', group="Trendicator Settings")
src2 = input(close, title='Trendicator Source', group="Trendicator Settings")
matype = input.int(1, minval=1, maxval=5, title='Trendicator Type: 1=SMA, 2=EMA, 3=HMA, 4=WMA, 5=VWMA', group="Trendicator Settings")

SMA = ta.sma(src2, length)
EMA = ta.ema(src2, length)
HMA = ta.wma(2 * ta.wma(src2, length / 2) - ta.wma(src2, length), math.round(math.sqrt(length)))
WMA = ta.wma(src2, length)
VWMA = ta.vwma(src2, length)


avgval = matype == 1 ? SMA : matype == 2 ? EMA : matype == 3 ? HMA : matype == 4 ? WMA : matype == 5 ? VWMA : na
Pcolor = avgval > avgval[1] ? color.new(#3179f5, 0) : color.new(#ec407a, 0)

plot(avgval, title='trendicator (ie: color changing moving average)', color=Pcolor, linewidth=2, style=plot.style_circles)

//praise be lady VVWAP!

var cumVol = 0.
cumVol += nz(volume)
if barstate.islast and cumVol == 0
runtime.error("No volume is provided by the data vendor.")

computeVWAP(src, isNewPeriod) =>
var float sumSrcVol = na
var float sumVol = na
var float sumSrcSrcVol = na

sumSrcVol := isNewPeriod ? src * volume : src * volume + sumSrcVol[1]
sumVol := isNewPeriod ? volume : volume + sumVol[1]
// sumSrcSrcVol calculates the dividend of the equation that is later used to calculate the standard deviation
sumSrcSrcVol := isNewPeriod ? volume * math.pow(src, 2) : volume * math.pow(src, 2) + sumSrcSrcVol[1]

_vwap = sumSrcVol / sumVol
variance = sumSrcSrcVol / sumVol - math.pow(_vwap, 2)
variance := variance < 0 ? 0 : variance
stDev = math.sqrt(variance)

[_vwap, stDev]

computeStdevBands(value, stdev, bandMult) =>
float upperBand = value + stdev * bandMult
float lowerBand = value - stdev * bandMult
[upperBand, lowerBand]

hideonDWM = input(false, title="Hide VWAP on 1D or Above", group="VWAP Settings: Praise Be Lady VWAP")
var anchor = input.string(defval = "Session", title="VWAP Anchor Period",
options=["Session", "Week", "Month", "Quarter", "Year", "Decade", "Century", "Earnings", "Dividends", "Splits"], group="VWAP Settings: Praise Be Lady VWAP")
src = input(title = "VWAP Source", defval = hlc3, group="VWAP Settings: Praise Be Lady VWAP")
offset = input(0, title="VWAP Offset", group="VWAP Settings: Praise Be Lady VWAP")

showBand_1 = input(true, title="", group="VWAP Settings: Praise Be Lady VWAP", inline="band_1")
stdevMult_1 = input(1.0, title="VWAP Bands Multiplier #1", group="VWAP Settings: Praise Be Lady VWAP", inline="band_1")
showBand_2 = input(true, title="", group="VWAP Settings: Praise Be Lady VWAP", inline="band_2")
stdevMult_2 = input(2.0, title="VWAP Bands Multiplier #2", group="VWAP Settings: Praise Be Lady VWAP", inline="band_2")
showBand_3 = input(true, title="", group="VWAP Settings: Praise Be Lady VWAP", inline="band_3")
stdevMult_3 = input(3.0, title="VWAP Bands Multiplier #3", group="VWAP Settings: Praise Be Lady VWAP", inline="band_3")

timeChange(period) =>
ta.change(time(period))

new_earnings = request.earnings(syminfo.tickerid, earnings.actual, barmerge.gaps_on, barmerge.lookahead_on, ignore_invalid_symbol=true)
new_dividends = request.dividends(syminfo.tickerid, dividends.gross, barmerge.gaps_on, barmerge.lookahead_on, ignore_invalid_symbol=true)
new_split = request.splits(syminfo.tickerid, splits.denominator, barmerge.gaps_on, barmerge.lookahead_on, ignore_invalid_symbol=true)

isNewPeriod = switch anchor
"Earnings" => not na(new_earnings)
"Dividends" => not na(new_dividends)
"Splits" => not na(new_split)
"Session" => timeChange("D")
"Week" => timeChange("W")
"Month" => timeChange("M")
"Quarter" => timeChange("3M")
"Year" => timeChange("12M")
"Decade" => timeChange("12M") and year % 10 == 0
"Century" => timeChange("12M") and year % 100 == 0
=> false

isEsdAnchor = anchor == "Earnings" or anchor == "Dividends" or anchor == "Splits"
if na(src[1]) and not isEsdAnchor
isNewPeriod := true

float vwapValue = na
float stdev = na
float upperBandValue1 = na
float lowerBandValue1 = na
float upperBandValue2 = na
float lowerBandValue2 = na
float upperBandValue3 = na
float lowerBandValue3 = na

if not (hideonDWM and timeframe.isdwm)
[_vwap, _stdev] = computeVWAP(src, isNewPeriod)
vwapValue := _vwap
stdev := _stdev
[upBV1, loBV1] = computeStdevBands(vwapValue, stdev, stdevMult_1)
upperBandValue1 := showBand_1 ? upBV1 : na
lowerBandValue1 := showBand_1 ? loBV1 : na
[upBV2, loBV2] = computeStdevBands(vwapValue, stdev, stdevMult_2)
upperBandValue2 := showBand_2 ? upBV2 : na
lowerBandValue2 := showBand_2 ? loBV2 : na
[upBV3, loBV3] = computeStdevBands(vwapValue, stdev, stdevMult_3)
upperBandValue3 := showBand_3 ? upBV3 : na
lowerBandValue3 := showBand_3 ? loBV3 : na

plot(vwapValue, title="VWAP", color=#00bcd4, offset=offset)

upperBand_1 = plot(upperBandValue1, title="VWAP Upper Band #1", color= color.new(#006064, 67), offset=offset, display = display.none)
lowerBand_1 = plot(lowerBandValue1, title="VWAP Lower Band #1", color= color.new(#006064, 67), offset=offset, display = display.none)
fill(upperBand_1, lowerBand_1, title="VWAP Bands Fill #1", color= color.new(#512da8, 90), display = display.none)

upperBand_2 = plot(upperBandValue2, title="VWAP Upper Band #2", color= color.new(#006064, 67), offset=offset, display = display.none)
lowerBand_2 = plot(lowerBandValue2, title="VWAP Lower Band #2", color= color.new(#006064, 67), offset=offset, display = display.none)
fill(upperBand_2, lowerBand_2, title="VWAP Bands Fill #2", color= color.new(#512da8, 90), display = display.none)

upperBand_3 = plot(upperBandValue3, title="VWAP Upper Band #3", color= color.new(#006064, 67), offset=offset,display = display.none)
lowerBand_3 = plot(lowerBandValue3, title="VWAP Lower Band #3", color= color.new(#006064, 67), offset=offset,display = display.none)
fill(upperBand_3, lowerBand_3, title="VWAP Bands Fill #3", color= color.new(#512da8, 90), display = display.none)



//bollinger bands 1 (BB1)

BB1_Length = input.int(20, minval=1, group="Bollinger Bands 1 Settings")
src_BB1 = input(close, title="BB1 Source", group="Bollinger Bands 1 Settings")
mult_BB1 = input.float(1.0, minval=0.001, maxval=50, title="BB1 StdDev", group="Bollinger Bands 1 Settings")
basis_BB1 = ta.sma(src_BB1, BB1_Length)
dev_BB1 = mult_BB1 * ta.stdev(src_BB1, BB1_Length)
upper_BB1 = basis_BB1 + dev_BB1
lower_BB1 = basis_BB1 - dev_BB1
offset_BB1 = input.int(0, "BB1 Offset", minval = -500, maxval = 500, group="Bollinger Bands 1 Settings")
plot(basis_BB1, "BB1 Basis", color = color.new(#ff9800, 100), offset = offset_BB1, display = display.none)
p1_BB1 = plot(upper_BB1, "BB1 Upper", color= color.new(#006064, 67), offset = offset_BB1)
p2_BB1 = plot(lower_BB1, "BB1 Lower", color= color.new(#006064, 67), offset = offset_BB1)
fill(p1_BB1, p2_BB1, title = "BB1 Background", color= color.new(#512da8, 87))

//bollinger bands 2 (BB2)
BB2_Length = input.int(20, minval=1, group="Bollinger Bands 2 Settings")
src_BB2 = input(close, title="BB2 Source", group="Bollinger Bands 2 Settings")
mult_BB2 = input.float(2.0, minval=0.001, maxval=50, title="BB2 StdDev", group="Bollinger Bands 2 Settings")
basis_BB2 = ta.sma(src_BB2, BB2_Length)
dev_BB2 = mult_BB2 * ta.stdev(src_BB2, BB2_Length)
upper_BB2 = basis_BB2 + dev_BB2
lower_BB2 = basis_BB2 - dev_BB2
offset_BB2 = input.int(0, "BB2 Offset", minval = -500, maxval = 500, group="Bollinger Bands 2 Settings")
plot(basis_BB2, "BB2 Basis", color = color.new(#ff9800, 100), offset = offset_BB2, display = display.none)
p1_BB2 = plot(upper_BB2, "BB2 Upper", color= color.new(#006064, 67), offset = offset_BB2)
p2_BB2 = plot(lower_BB2, "BB2 Lower", color= color.new(#006064, 67), offset = offset_BB2)
fill(p1_BB2, p2_BB2, title = "BB2 Background", color= color.new(#512da8, 87))

//bollinger bands 3 (BB3)
BB3_Length = input.int(20, minval=1, group="Bollinger Bands 3 Settings")
src_BB3 = input(close, title="BB3 Source", group="Bollinger Bands 3 Settings")
mult_BB3 = input.float(3.0, minval=0.001, maxval=50, title="BB3 StdDev", group="Bollinger Bands 3 Settings")
basis_BB3 = ta.sma(src_BB3, BB3_Length)
dev_BB3 = mult_BB3 * ta.stdev(src_BB3, BB3_Length)
upper_BB3 = basis_BB3 + dev_BB3
lower_BB3 = basis_BB3 - dev_BB3
offset_BB3 = input.int(0, "BB3 Offset", minval = -500, maxval = 500, group="Bollinger Bands 3 Settings")
plot(basis_BB3, "BB3 Basis", color = color.new(#ff9800, 100), offset = offset_BB3, display = display.none)
p1_BB3 = plot(upper_BB3, "BB3 Upper", color= color.new(#006064, 67), offset = offset_BB3)
p2_BB3 = plot(lower_BB3, "BB3 Lower", color= color.new(#006064, 67), offset = offset_BB3)
fill(p1_BB3, p2_BB3, title = "BB3 Background", color= color.new(#512da8, 87))
Attachments
Who knows others is wise
Who knows himself is enlightened


Re: Already Converted TradingView Indicators to MT4 Indicators

296
rcbarlow wrote: Sun Mar 26, 2023 6:18 am Would someone please convert the "Path" indicator from Tradingview to MT4?
Thank you.
What is the post bro?
if you are asking for free work, be a little better and do the work why the indicator should be converted and its benefits. If the code is available, upload it. No one will do the work for you and look things up for you......
These users thanked the author kvak for the post (total 8):
Greg82, sylvester21, BeatlemaniaSA, RodrigoRT7, Jimmy, moey_dw, Jedidiah, boytoy

Re: Already Converted TradingView Indicators to MT4 Indicators

298
rcbarlow wrote: Sun Mar 26, 2023 6:18 am Would someone please convert the "Path" indicator from Tradingview to MT4?
Thank you.
These users thanked the author moey_dw for the post (total 3):
Woodyz, Jedidiah, boytoy
Official Forex-station GIF animator at your service 👨‍⚖️
See a GIF with Forex-station.com on it? I probably made it
The best divergence indicator in the world.
Real news exists: Infowars.com 👈

DislikeRe: Already Converted TradingView Indicators to MT4 Indicators

299
rcbarlow wrote: Sun Mar 26, 2023 6:18 am Would someone please convert the "Path" indicator from Tradingview to MT4?
Thank you.
This post is rubbish. You've given us nothing to work with.

And there I was thinking this post was shit... but along comes this ultra-lazy guy who completely tops it off with zero anything.

Topic has now been cleaned - especially the other 3 x posts that had no text - just a YouTube video slapped in & a wink emoji.

Christ...

Come on guys.
These users thanked the author Jimmy for the post (total 6):
RplusT, moey_dw, boytoy, BeatlemaniaSA, kvak, andrei-1
Guide to the "All Averages" Filters (ADXvma, Laguerre etc.) 🆕
Use Fibonacci numbers for indicator settings + How to draw Fibonacci Extensions
An easy trick for drawing Support & Resistance

Re: Already Converted TradingView Indicators to MT4 Indicators

300
Of all the indicators I've tested on tradingview. This is my favorite because even if its wrong in identifying the trend. It will take you out with a very small loss or even a gain. It also is great for a filter or confirmation paired with other indicators. Attached is a couple of pictures with the name and what it looks like on the chart. Ill also include the source code. I got a strategy coded and the results very promising but it was coded in the pinescript version 2 and when I try to convert it to the latest version of tradingview code language I ran into issues. I was hoping that one the great coders here can help me convert this into a metatrader 4 indicator. The indicator code has a youtube link in it that describes one of the strategies used with the indicator but Im sure it can be coded without that link to youtube.



//@version=2
study("TrendAlert", overlay=false)

// Trend and direction determination Step 1 en Step 2 method conform ZoneRecovery from 4x-dat.com Joseph Nemeth
//
// step 1 LongTerm timefram/resolution (LT) determine general direction
//• color last Heikenahsi bar gives is the general direction
// step 2 MidTerm timeframe/resolution determine trend
//• color last Heikenahsi bar must match Direction step 1 and
//• slope of 20EMA in direction step 1 and
//• price relation to EMA20: above = up, below=down
// Step 1 AND step 2 => TrendAlert (-1 for Short, 1 for Long, 0 for No trend)

//Heiken Ashi Candles
data = heikenashi(tickerid)
resLT = input(title="Res LT", type=resolution, defval="D")
resMT = input(title="Res MT", type=resolution, defval="240")


LTo = security(data, resLT, open)
LTc = security(data, resLT, close)
MTo = security(data, resMT, open)
MTc = security(data, resMT, close)

LTlong = LTc > LTo
LTshort = LTc < LTo
MTema20 = ema(MTc,20)
MTema20delta= change(MTema20)

MTlong = MTc > MTo and MTc > MTema20 and MTema20delta > 0
MTshort = MTc < MTo and MTc < MTema20 and MTema20delta < 0



Long = MTlong and LTlong
Short = MTshort and LTshort

plot(Long ? 1 : Short ? -1: 0, title="TrendAlert", color= Long ? lime : Short ? red : gray, style=columns )
Attachments


Who is online

Users browsing this forum: AdeelFx0, Ahrefs [Bot], Amazon [Bot], Applebot [Crawler], ChatGPT [Bot], for28, Grapeshot [Bot], kvak, Trendiction [Bot], waylon, Xxcoincoin, Yandex [Bot] and 116 guests