Hello coders anyone can make this MACD strategy as a bot in trading view ? thanks
//@version=5
strategy("MACD Strategy", overlay=true)
fastLength = input(12)
slowlength = input(26)
MACDLength = input(9)
MACD = ta.ema(close, fastLength) - ta.ema(close, slowlength)
aMACD = ta.ema(MACD, MACDLength)
delta = MACD - aMACD
if (ta.crossover(delta, 0))
strategy.entry("MacdLE", strategy.long, comment="MacdLE")
if (ta.crossunder(delta, 0))
strategy.entry("MacdSE", strategy.short, comment="MacdSE")
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
Re: Already Converted TradingView Indicators to MT4 Indicators
212There is a simple ma cross EA here Simple Ea match the ma's and the fast/slow settings and it will be basically the same.AxelJ wrote: Sat Jan 07, 2023 8:43 am Hello coders anyone can make this MACD strategy as a bot in trading view ? thanks
//@version=5
strategy("MACD Strategy", overlay=true)
fastLength = input(12)
slowlength = input(26)
MACDLength = input(9)
MACD = ta.ema(close, fastLength) - ta.ema(close, slowlength)
aMACD = ta.ema(MACD, MACDLength)
delta = MACD - aMACD
if (ta.crossover(delta, 0))
strategy.entry("MacdLE", strategy.long, comment="MacdLE")
if (ta.crossunder(delta, 0))
strategy.entry("MacdSE", strategy.short, comment="MacdSE")
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
Re: Already Converted TradingView Indicators to MT4 Indicators
213thanks mt tools but i need it in trading view the same , the result is amazing
Re: Already Converted TradingView Indicators to MT4 Indicators
214Hi I'm looking for the ATR Stop Loss Finder by very fid
basically it's a multiple atr placed above and below the high and low of the price bar
default is 14 period atr with RMA or SMMA, 1.5 x ATR multipler surely MT4 have done this, I can't find it
basically it's a multiple atr placed above and below the high and low of the price bar
default is 14 period atr with RMA or SMMA, 1.5 x ATR multipler surely MT4 have done this, I can't find it
Code: Select all
//@version=4
study(title="Average True Range Stop Loss Finder", shorttitle="ATR", overlay=true)
length = input(title="Length", defval=14, minval=1)
smoothing = input(title="Smoothing", defval="RMA", options=["RMA", "SMA", "EMA", "WMA"])
m = input(1.5, "Multiplier")
src1 = input(high)
src2 = input(low)
pline = input(true, "Show Price Lines")
col1 = input(color.blue, "ATR Text Color")
col2 = input(color.teal, "Low Text Color",inline ="1")
col3 = input(color.red, "High Text Color",inline ="2")
collong = input(color.teal, "Low Line Color",inline ="1")
colshort = input(color.red, "High Line Color",inline ="2")
ma_function(source, length) =>
if smoothing == "RMA"
rma(source, length)
else
if smoothing == "SMA"
sma(source, length)
else
if smoothing == "EMA"
ema(source, length)
else
wma(source, length)
a = ma_function(tr(true), length) * m
x = ma_function(tr(true), length) * m + src1
x2 = src2 - ma_function(tr(true), length) * m
p1 = plot(x, title = "ATR Short Stop Loss", color= colshort, transp=20, trackprice = pline ? true : false)
p2 = plot(x2, title = "ATR Long Stop Loss", color= collong, transp=20, trackprice = pline ? true : false)
var table Table = table.new(position.bottom_center, 3, 1, border_width = 3)
f_fillCell(_table, _column, _row, _value, _timeframe) =>
_cellText = _timeframe+ tostring(_value, "#.#")
table.cell(_table, _column, _row, _cellText, text_color = col1)
table.cell_set_text_color(Table, 1, 0, color.new(col3, transp = 0))
table.cell_set_text_color(Table, 2, 0, color.new(col2, transp = 0))
if barstate.islast
f_fillCell(Table, 0, 0, a, "ATR: " )
f_fillCell(Table, 1, 0, x, "H: " )
f_fillCell(Table, 2, 0, x2, "L: " )
Re: Already Converted TradingView Indicators to MT4 Indicators
215ATR Stop Loss Finder for MT4Marktaylor58 wrote: Sat Jan 14, 2023 2:52 pm Hi I'm looking for the ATR Stop Loss Finder by very fid
basically it's a multiple atr placed above and below the high and low of the price bar
default is 14 period atr with RMA or SMMA, 1.5 x ATR multipler surely MT4 have done this, I can't find itCode: Select all
//@version=4 study(title="Average True Range Stop Loss Finder", shorttitle="ATR", overlay=true)
This version seems to be close to what you are looking for.
Concept
The ATR Stop Loss Finder uses Average True Range to determine a safe place to put stop losses to avoid being stop hunted or stopped out of a trade due to a tight stop loss.
For advance traders it can also be used as a guide for setting take profit or strong breakout areas as price hits other trader's stop losses.
Default multiplier setting is 1.5.
- Conservative traders can use a stop loss value of 2
- An even tighter stop loss value of 1 can also be used, too. This is used as a guide for watching price hit other trader's SL and where price can continue further.
- These users thanked the author mrtools for the post (total 11):
- Jedidiah, Jimmy, josi, kvak, iPar, mystylez007, TransparentTrader, RodrigoRT7, Marktaylor58, eduarescobar, mosape
Re: Already Converted TradingView Indicators to MT4 Indicators
216Very useful. Thank you very much. Can we have an on/off button for the ATR Stop Loss Finder for MT4 please?
Re: Already Converted TradingView Indicators to MT4 Indicators
217Added the on/off button.mystylez007 wrote: Mon Jan 16, 2023 3:27 am Very useful. Thank you very much. Can we have an on/off button for the ATR Stop Loss Finder for MT4 please?
- These users thanked the author mrtools for the post (total 5):
- Jedidiah, Marktaylor58, RodrigoRT7, Ricstar_8, yoki
Re: Already Converted TradingView Indicators to MT4 Indicators
218Thanks for this it's great. Are you able to have an option to replace the ATR lines with a selection of symbols instead such as a dot, square, arrow, diamond, triangle etc with various size selections?
Thanks again
Thanks again
Re: Already Converted TradingView Indicators to MT4 Indicators
219Could you check the file attached please? I don't see the on/off button option.
- These users thanked the author mystylez007 for the post:
- RodrigoRT7
Re: Already Converted TradingView Indicators to MT4 Indicators
220Yep, you're right, try now.mystylez007 wrote: Tue Jan 17, 2023 3:53 am Could you check the file attached please? I don't see the on/off button option.
- These users thanked the author mrtools for the post (total 9):
- 太虚一毫, Jedidiah, Chickenspicy, RodrigoRT7, Tesako, Jimmy, Marktaylor58, qwepoi123, rsquared1