hello everyone, i wrote a code for a bot i want to create but will need help in correcting some few erros as i cannot get it to work with trading view.
here it is:\
//version=5
study("My Indicator")
// Define EMA variables
ema50 = ema(close, 50)
ema200 = ema(close, 200)
// Define ADX variable
adxVal = adx(14)
// Define RSI variable
rsiVal = rsi(close, 14)
// Buy Signal
if (ema50 > ema200 and adxVal > 30 and rsiVal < 70 and volume > average(volume, 50))
strategy.entry("Buy", strategy.long)
// Sell Signal
if (ema50 < ema200 and adxVal < 30 and rsiVal > 70 and volume > average(volume, 50))
strategy.entry("Sell", strategy.short)
here it is:\
//version=5
study("My Indicator")
// Define EMA variables
ema50 = ema(close, 50)
ema200 = ema(close, 200)
// Define ADX variable
adxVal = adx(14)
// Define RSI variable
rsiVal = rsi(close, 14)
// Buy Signal
if (ema50 > ema200 and adxVal > 30 and rsiVal < 70 and volume > average(volume, 50))
strategy.entry("Buy", strategy.long)
// Sell Signal
if (ema50 < ema200 and adxVal < 30 and rsiVal > 70 and volume > average(volume, 50))
strategy.entry("Sell", strategy.short)
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
