搜尋
產品
社群
市場
新聞
經紀商
更多
TW
立即開始
社群
/
投資想法
/
PRI param
Bitcoin / TetherUS
PRI param
由atomphone14061988提供
關注
關注
2023年12月4日
0
2023年12月4日
code
//
version
=5
strategy("CDC Action Zone V.2 Strategy", overlay=true)
src = input(title="Data Array", type=input.source, defval=ohlc4)
prd1 = input(title="Short MA period", type=input.integer, defval=12)
prd2 = input(title="Long MA period", type=input.integer, defval=26)
AP = ema(src, 2)
Fast = ema(AP, prd1)
Slow = ema(AP, prd2)
Bullish = Fast > Slow
Bearish = Fast < Slow
Green = Bullish and AP > Fast
Red = Bearish and AP < Fast
Yellow = Bullish and AP < Fast
Blue = Bearish and AP > Fast
Buy = Bullish and Bearish[1]
Sell = Bearish and Bullish[1]
// Enter long when Buy condition is met
strategy.entry("Long", strategy.long, when = Buy)
// Enter short when Sell condition is met
strategy.entry("Short", strategy.short, when = Sell)
// Close the long when the short condition is met
strategy.close("Long", when = Sell)
// Close the short when the long condition is met
strategy.close("Short", when = Buy)
// Plot
plot(Fast, "Fast", linewidth=1, color=color.red)
plot(Slow, "Slow", linewidth=2, color=color.blue)
// Color bars based on conditions
bcolor = Green ? color.lime : Red ? color.red : Yellow ? color.yellow : Blue ? color.blue : color.white
barcolor(color=bcolor)
fill(plot1, plot2, bcolor)
Technical Indicators
Trend Analysis
Wave Analysis
atomphone14061988
關注
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在
使用條款
閱讀更多資訊。