
1-3-1 紅緑K線反転戦略は,K線形状に基づいて買入シグナルを判断する戦略である.この戦略は,1つの赤いK線が3つの緑のK線によって反転されているかどうかを観察して買入の機会を探している.
この戦略の核心的な論理は:
この戦略により,赤K線が反転したときに購入することができます. 傾向が上昇する可能性が高いからです. リスクを管理し,利益をロックするために,ストップとストップを設定します.
1-3-1 赤い緑のK線反転戦略には以下の利点があります.
この戦略にはいくつかのリスクがあります.
対策として
この戦略は以下の点で最適化できます.
大盘指数に基づくフィルタリング.大盘の短期および中期トレンドに基づいて取引信号をフィルタリングし,大盘が上昇すると購入し,大盘が低下すると取引を停止することができます.
取引量の確認を考慮する. 緑のK線の取引量に対する判断を増やす. 取引量が大きくなった場合にのみ購入する.
停止停止比率を最適化する.異なる停止停止比率をテストして,最適なパラメータの組み合わせを見つける.動的停止または移動停止を設定することもできます.
ポジション管理の最適化. ポジションは,条件が満たされたときに,後日追加され,単一取引のリスクを低減することができる.
平均線,波動率などの指標を考慮して,トレンドがより明確になると購入することを保証します.
ビッグデータトレーニングは,最適なパラメータを探します.大量の歴史的データを収集し,機械学習などの技術を使用して最適なパラメータの値を訓練します.
1-3-1 紅緑K線反転戦略は,全体として,シンプルで実用的なショートライン取引戦略である. 明確な入場・退出ルールがあり,反測効果が良好である. いくつかの最適化措置によって,その实体効果を向上させ,信頼できる量化取引戦略にすることができる. 同時に,リスク管理に注意し,資金を適切に管理する必要があります.
/*backtest
start: 2023-09-26 00:00:00
end: 2023-10-26 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
//by Genma01
strategy("Stratégie tradosaure 1 Bougie Rouge suivi de 3 Bougies Vertes", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)
// Définir les paramètres
var float stopLossPrice = na
var float takeProfitPrice = na
var float stopLossPriceD = na
var float takeProfitPriceD = na
// Vérifier les conditions
redCandle = close[3] < open[3] and low[3] < low[2] and low[3] < low[1] and low[3] < low[0]
greenCandles = close > open and close[1] > open[1] and close[2] > open[2]
higherClose = close > close[1] and close[1] > close[2]
// Calcul du stop-loss
if (redCandle and greenCandles and higherClose) and strategy.position_size == 0
stopLossPrice := low[3]
// Calcul du take-profit
if (not na(stopLossPrice)) and strategy.position_size == 0
takeProfitPrice := close + (close - stopLossPrice)
// Entrée en position long
if (redCandle and greenCandles and higherClose) and strategy.position_size == 0
strategy.entry("Long", strategy.long)
// Sortie de la position
if (not na(stopLossPrice)) and strategy.position_size > 0
strategy.exit("Take Profit/Stop Loss", stop=stopLossPrice, limit=takeProfitPrice)
if strategy.position_size == 0
stopLossPriceD := na
takeProfitPriceD := na
else
stopLossPriceD := stopLossPrice
takeProfitPriceD := takeProfitPrice
// Tracer le stop-loss et le take-profit sur le graphique
plotshape(series=redCandle and greenCandles and higherClose and strategy.position_size == 0, title="Conditions Remplies", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(series=redCandle and greenCandles and higherClose and strategy.position_size == 0, title="Conditions Remplies", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
// Afficher les prix du stop-loss et du take-profit
plot(stopLossPriceD, color=color.red, title="Stop Loss Price", linewidth=2, style = plot.style_linebr)
plot(takeProfitPriceD, color=color.green, title="Take Profit Price", linewidth=2, style = plot.style_linebr)