搜索
产品
社区
市场
新闻
经纪商
更多
CN
开始
社区
/
观点
/
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提供或认可的金融、投资、交易或其它类型的建议或背书。请在
使用条款
阅读更多信息。