Chinese article is here. Using Google chrome translate English product feature, the article in English CAN easily be translated to English.
Order tradingview.com here.
Monthly $49/ month premium version - Pine script can be easily written and then buy and sell stocks can be processed automatically by script.
//@version=5
strategy("Take profits & stop losses", overlay=true)
// Create Indicator's
shortSMA = ta.sma(close, 10)
longSMA = ta.sma(close, 30)
rsi = ta.rsi(close, 14)
atr = ta.atr(14)
// Specify crossover conditions
longCondition = ta.crossover(shortSMA, longSMA)
shortCondition = ta.crossunder(shortSMA, longSMA)
// Execute trade if condition is True
if (longCondition)
stopLoss = low - atr * 2
takeProfit = high + atr * 2
strategy.entry("long", strategy.long, 100, when = rsi > 50)
strategy.exit("exit", "long", stop=stopLoss, limit=takeProfit)
if (shortCondition)
stopLoss = high + atr * 2
takeProfit = low - atr * 2
strategy.entry("short", strategy.short, 100, when = rsi < 50)
strategy.exit("exit", "short", stop=stopLoss, limit=takeProfit)
// Plot Moving Average's to chart
plot(shortSMA)
plot(longSMA, color=color.black)
No comments:
Post a Comment