Best cloud all ma indicator
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Best cloud all ma indicator
- This topic has 3 replies, 2 voices, and was last updated 7 months ago by Stenozar.
-
-
04/10/2024 at 6:03 PM #231369
Buonasera, è possibile convertire questo indicatore di Tradingview? ecco il codice:
// @version=4
// @author=Daveatt// Cloud MM
StudyName = “BEST Cloud ALL MA”
ShortStudyName = “BEST Cloud ALL MA”
study(StudyName, shorttitle=ShortStudyName, overlay=true)source = input(close, title=”Source”)
typeofMA1 = input(title=”Type of Moving Average”, defval=”EMA”, options=[“RMA”, “SMA”, “EMA”, “WMA”, “VWMA”, “SMMA”, “TMA”, “HullMA”, “DEMA”, “TEMA”, “VWAP”])
length_ma1 = input(30, title = “[ALL but VWAP] Length of Moving Average 1″, type=input.integer)
typeofMA2 = input(title=”Type of Moving Average”, defval=”EMA”, options=[“RMA”, “SMA”, “EMA”, “WMA”, “VWMA”, “SMMA”, “TMA”, “HullMA”, “DEMA”, “TEMA”, “VWAP”])
length_ma2 = input(74, title = “[ALL but VWAP] Length of Moving Average 2″, type=input.integer)color_candles = input(true, title=”Color based on trend?”)
f_smma(src, len) =>
smma = 0.0
smma := na(smma[1]) ? sma(src, len) : (smma[1] * (len – 1) + src) / len
smmaf_hullma(src, length) =>
wma(2 * wma(src, length / 2) – wma(src, length), round(sqrt(length)))f_tma(src, length) =>
sma(sma(src, length), length)f_dema(src, length) =>
emaValue = ema(src, length)
2 * emaValue – ema(emaValue, length)f_tema(src, length) =>
ema1 = ema(src, length)
ema2 = ema(ema1, length)
ema3 = ema(ema2, length)
(3 * ema1) – (3 * ema2) + ema3f_ma(smoothing, src, length) =>
iff(smoothing == “RMA”, rma(src, length),
iff(smoothing == “SMA”, sma(src, length),
iff(smoothing == “EMA”, ema(src, length),
iff(smoothing == “WMA”, wma(src, length),
iff(smoothing == “VWMA”, vwma(src, length),
iff(smoothing == “SMMA”, f_smma(src, length),
iff(smoothing == “HullMA”, f_hullma(src, length),
iff(smoothing == “VWAP”, vwap(hlc3),
iff(smoothing == “DEMA”, f_dema(src, length),
iff(smoothing == “TEMA”, f_tema(src, length), src))))))))))MA1 = f_ma(typeofMA1, source, length_ma1)
MA2 = f_ma(typeofMA2, source, length_ma2)plot_ma1 = plot(MA1, color=color.new(color.green, 0), linewidth=3, title = “MA1”)
plot_ma2 = plot(MA2, color=color.new(color.red, 0), linewidth=3, title = “MA2″)fill_color = MA1 > MA2 ? color.new(color.green, 60) : color.new(color.red, 60)
fill(plot_ma1, plot_ma2, color=fill_color)// Candles coloring
clr = not color_candles ? na :
MA1 > MA2 ? color.new(color.lime, 40) : color.new(color.fuchsia, 40)barcolor(clr,title=”Trend State Bar Colouring”)
cond_buy = MA1 > MA2 and crossover(MA1, MA2)
cond_sell = MA1 < MA2 and crossunder(MA1, MA2)// green triangle
plotshape(cond_buy, style=shape.triangleup, location=location.belowbar, color=color.new(color.green, 0), size=size.large)
// red triangle
plotshape(cond_sell, style=shape.triangledown, location=location.abovebar, color=color.new(color.red, 0), size=size.large)alertcondition(cond_buy, title=’Buy Alert’, message=”Buy Alert”)
alertcondition(cond_sell, title=’Sell Alert’, message=”Sell Alert”)Grazie
04/11/2024 at 9:24 AM #231394Ciao. Lo metto in coda. Per richieste future, inserisci il codice nel formato codice PRT in modo che non ci siano errori. Allega anche le immagini dell'indicatore per vederlo. Grazie
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576// @version=4// @author=Daveatt// Cloud MMStudyName = “BEST Cloud ALL MA”ShortStudyName = “BEST Cloud ALL MA”study(StudyName, shorttitle=ShortStudyName, overlay=true)source = input(close, title=”Source”)typeofMA1 = input(title=”Type of Moving Average”, defval=”EMA”, options=[“RMA”, “SMA”, “EMA”, “WMA”, “VWMA”, “SMMA”, “TMA”, “HullMA”, “DEMA”, “TEMA”, “VWAP”])length_ma1 = input(30, title = “[ALL but VWAP] Length of Moving Average 1″, type=input.integer)typeofMA2 = input(title=”Type of Moving Average”, defval=”EMA”, options=[“RMA”, “SMA”, “EMA”, “WMA”, “VWMA”, “SMMA”, “TMA”, “HullMA”, “DEMA”, “TEMA”, “VWAP”])length_ma2 = input(74, title = “[ALL but VWAP] Length of Moving Average 2″, type=input.integer)color_candles = input(true, title=”Color based on trend?”)f_smma(src, len) =>smma = 0.0smma := na(smma[1]) ? sma(src, len) : (smma[1] * (len – 1) + src) / lensmmaf_hullma(src, length) =>wma(2 * wma(src, length / 2) – wma(src, length), round(sqrt(length)))f_tma(src, length) =>sma(sma(src, length), length)f_dema(src, length) =>emaValue = ema(src, length)2 * emaValue – ema(emaValue, length)f_tema(src, length) =>ema1 = ema(src, length)ema2 = ema(ema1, length)ema3 = ema(ema2, length)(3 * ema1) – (3 * ema2) + ema3f_ma(smoothing, src, length) =>iff(smoothing == “RMA”, rma(src, length),iff(smoothing == “SMA”, sma(src, length),iff(smoothing == “EMA”, ema(src, length),iff(smoothing == “WMA”, wma(src, length),iff(smoothing == “VWMA”, vwma(src, length),iff(smoothing == “SMMA”, f_smma(src, length),iff(smoothing == “HullMA”, f_hullma(src, length),iff(smoothing == “VWAP”, vwap(hlc3),iff(smoothing == “DEMA”, f_dema(src, length),iff(smoothing == “TEMA”, f_tema(src, length), src))))))))))MA1 = f_ma(typeofMA1, source, length_ma1)MA2 = f_ma(typeofMA2, source, length_ma2)plot_ma1 = plot(MA1, color=color.new(color.green, 0), linewidth=3, title = “MA1”)plot_ma2 = plot(MA2, color=color.new(color.red, 0), linewidth=3, title = “MA2″)fill_color = MA1 > MA2 ? color.new(color.green, 60) : color.new(color.red, 60)fill(plot_ma1, plot_ma2, color=fill_color)// Candles coloringclr = not color_candles ? na :MA1 > MA2 ? color.new(color.lime, 40) : color.new(color.fuchsia, 40)barcolor(clr,title=”Trend State Bar Colouring”)cond_buy = MA1 > MA2 and crossover(MA1, MA2)cond_sell = MA1 < MA2 and crossunder(MA1, MA2)// green triangleplotshape(cond_buy, style=shape.triangleup, location=location.belowbar, color=color.new(color.green, 0), size=size.large)// red triangleplotshape(cond_sell, style=shape.triangledown, location=location.abovebar, color=color.new(color.red, 0), size=size.large)alertcondition(cond_buy, title=’Buy Alert’, message=”Buy Alert”)alertcondition(cond_sell, title=’Sell Alert’, message=”Sell Alert”)04/11/2024 at 11:34 AM #231404Hola qui hai l'indicatore
PRC_Best Cloud Tutti Media mobile123456789101112131415161718192021222324252627282930313233343536373839404142//-----------------------------------------------------////PRC_Best Cloud All Moving average//version = 0//11.04.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//-----------------------------------------------------////-----Inputs------------------------------------------//source=customclosetypeofMA1=1//Type of Moving Average 1lengthMA1=30//Length of Moving average 1typeofMA2=1//Type of Moving Average 2lengthMA2=74//Length of Moving average 2colorcandles=1//Color Candles based on trend?//-----------------------------------------------------////-----Moving averages Definition----------------------//ma1=average[lengthMA1,typeofMA1](source)ma2=average[lengthMA2,typeofMA2](source)//-----------------------------------------------------////-----Fill color between MAs--------------------------//if ma1 > ma2 thenr=0g=255elser=255g=0endifcolorbetween(ma1,ma2,r,g,0,60)//-----------------------------------------------------////-----Color Candles based on trend--------------------//if colorcandles thenDRAWCANDLE(open, high, low, close)coloured(r,g,0)endif//-----------------------------------------------------////-----Plot Signals Buy and Sell-----------------------//if ma1 crosses over ma2 thendrawarrowup(barindex,low-0.25*tr)coloured("green")elsif ma1 crosses under ma2 thendrawarrowdown(barindex,high+0.25*tr)coloured("red")endif//-----------------------------------------------------//return ma1 as "MA1"coloured("green")style(line,2),ma2 as "MA2"coloured("red")style(line,2)04/11/2024 at 8:49 PM #231420 -
AuthorPosts
Find exclusive trading pro-tools on