Can You help me and :
_ convert to MT4
_ add SMMA
_ add MTF
_ add button ON / OFF
Code: Select all
indicator(title='Kanały średnich', overlay=true, timeframe="")
short = input(33, "Wartość short")
long = input(144, "Wartość long")
srednia(src, length, type) =>
switch type
"RMA" => ta.rma(src, length)
"EMA" => ta.ema(src, length)
"SMA" => ta.sma(src, length)
"WMA" => ta.wma(src, length)
"VWMA" => ta.vwma(src, length)
metoda = input.string(title = "Metoda liczenia średniej", defval = "RMA", options=["RMA", "EMA", "SMA", "WMA", "VWMA"])
shortl = srednia(low, short, metoda)
shorth = srednia(high, short, metoda)
longl = srednia(low, long, metoda)
longh = srednia(high, long, metoda)
plot(shortl, color=color.new(color.aqua, 0), linewidth=1, title="Short low") // Low 33
plot(shorth, color=color.new(color.aqua, 0), linewidth=1, title="Short high") // High 33
plot(longl, color=color.new(color.red, 0), linewidth=1, title="Long low") // Low 144
plot(longh, color=color.new(color.red, 0), linewidth=1, title="Long high") // High 144
Thx and regards
Greg