
この戦略は,Awesome Oscillator ((AO) の指標によってトレンドの方向を判断し,移動平均と組み合わせてトレンド確認を行う.これはトレンド追跡戦略の1つである.AOの指標が0軸を穿越し,高速線が遅い線を穿越するときに多行し,AOの指標が0軸を穿越し,高速線が遅い線を穿越するときに空きをする.トレンドの方向性を利用して利益を得る.
この戦略は,トレンドの方向を判断するために主にAO指標に基づいて判断する.AO指標は,}-{ラインの真ん中点と5周期,34周期の単純な移動平均の差を計算して得られ,Momentumカテゴリ指標に属する.AO指標が正であるとき,短期移動平均が長期移動平均より高いことを代表する,Should be interpreted as a bullish sign.逆に,AOが負であるとき,短期移動平均が長期移動平均より低いことを代表する,Should be interpreted as a bearish sign.
したがって,AO指標は,トレンドの方向を効果的に判断できます.AOの0軸を横切るときは,市場トレンドが負の方向に転移することを代表し,多めにすべきです.AOの0軸を横切るときは,市場トレンドが負の方向に転移することを代表し,空きすべきです.
また,この戦略には20周期と200周期の移動平均も加えられている.この2つの平均線の角度は,中長期のトレンドの方向を表している.短期的なトレンドの方向を判断するために,AO指標のみに頼るのは不十分であり,中長期のトレンドの確認も必要であるため,移動平均の判断も加えられている.
急速平均線上を通過すると,中長期トレンドが看板に転じるとき,我々はAO上を通過すると 0軸で,トレンドが上昇すると利益を得ます.急速平均線下を通過すると,中長期トレンドが下落すると,我々はAOの下を通過すると 0軸で空いて,トレンドが低下すると利益を得ます.
この策略は,簡単なトレンド追跡策略の1つであり,AO指標によって短期トレンドを判断し,中長期トレンドを確認する考え方が正しい.AO指標と移動平均の組み合わせは広く使用され,より成熟しており,この策略は強力な信頼性を持っています.さらにパラメータの最適化と組合せ指標の最適化により,この策略の効果をさらに優れたものにすることができます.
/*backtest
start: 2023-12-12 00:00:00
end: 2023-12-14 20:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// https://www.youtube.com/watch?v=zr3AVwjCtDA
//@version=5
strategy(title="Bingx ESTRATEGIA de Trading en 1 minuto ", shorttitle="AO")
long = input.bool(true, "long")
short = input.bool(true, "short")
profit = (input.float(10, "profit") / 100) + 1
stop = (input.float(5, "stop") / 100) + 1
ao = ta.sma(hl2,5) - ta.sma(hl2,34)
diff = ao - ao[1]
plot(ao, color = diff <= 0 ? #F44336 : #009688, style=plot.style_columns)
changeToGreen = ta.crossover(diff, 0)
changeToRed = ta.crossunder(diff, 0)
alertcondition(changeToGreen, title = "AO color changed to green", message = "Awesome Oscillator's color has changed to green")
alertcondition(changeToRed, title = "AO color changed to red", message = "Awesome Oscillator's color has changed to red")
ema20 = ta.ema(close, 20)
ema200 = ta.ema(close, 200)
rsi = ta.rsi(close, 7)
plot(rsi)
plot(0, color=color.white)
var float pentry = 0.0
var float lentry = 0.0
var bool oab = false
// oab := ta.crossover(ao, 0) ? true : ta.crossover(0, ao) ? false : oab[1]
if long and close > open and ta.crossover(close, ema20) and ema20 > ema200 and ao > 0 and rsi > 50
strategy.entry("long", strategy.long)
pentry := close
strategy.exit("exit long", "long", limit=pentry * profit, stop=pentry / stop)
if short and close < open and ta.crossunder(close, ema20) and ema20 < ema200 and ao < 0 and rsi < 50
strategy.entry("short", strategy.short)
lentry := close
strategy.exit("exit short", "short", limit=lentry / profit, stop=lentry * stop)