EMA-クロス-JC トレイリングSLとの内日

作者: リン・ハーンチャオチャン, 日付: 2023-09-04 15:39:54
タグ:

EMA-クロス-JC・イントラデイとトライリングSL戦略

EMA-Cross-JC Intraday with Trailing SL戦略は,指数移動平均 (EMA) を利用して取引機会を特定する技術的な取引戦略である.この戦略は,日内タイムフレームで使用するように設計されており,ロングおよびショートポジションの両方を取引するために使用することができる.

この戦略は,速いEMAと遅いEMAの間のクロスオーバーを特定することによって機能する.速いEMAが遅いEMAを超えると,購入信号が生成される.速いEMAが遅いEMAを下回ると,販売信号が生成される.

この戦略は,リスク管理のためにトライリングストップロスを利用する.トライリングストップロスは,資産の価格がトレーダーの好みに動くと上昇するダイナミックストップロスである.これはトレーダーの損失が制限されていることを保証し,可能な限り多くの潜在的な利益に参加できるようにする.

EMA-Cross-JC Intraday with Trailing SL戦略は,比較的使いやすい戦略ですが,非常に効果的です.この戦略は,健全な技術的原則に基づいています.そして,それは時間とともに収益性が証明されています.

以下は,EMA-Cross-JC Intraday と Trailing SL の戦略を使用する利点のいくつかです.

簡単な戦略で,あらゆる経験レベルのトレーダーが利用できます. 健全な技術原理に基づいているので 成功する可能性が高いのです トレーリングストップロスを利用してリスクを管理し,トレーダーを大きな損失から保護します. ロング・ショート・ポジションの両方を取引するために使用でき,汎用的な戦略です. 以下は,EMA-Cross-JC Intraday with Trailing SL 戦略を使用するリスクの一部です.

この戦略は,過去の価格データに基づいているため,将来的に利益を得られる保証はない. この戦略は,資産の価格が両方向に急速に動いているときに,ウィップソーに易くなります. 戦略は不安定で,大きな損失のリスクがあります. EMA-Cross-JC Intraday with Trailing SL戦略は,全体的に見ると,あらゆる経験レベルのトレーダーが使用できる比較的シンプルで効果的な取引戦略です.しかし,いかなる取引戦略も利益をもたらす保証がないことを覚えておくことは重要です.そして,トレーダーは常にいかなる取引戦略も使用する際に注意を払うべきです.

この 記事 が 役立ち,情報 を 提供 し て くれ た と 期待 し て い ます.これ以上 の 質問 が ある なら,気軽 に 尋ね て ください.


/*backtest
start: 2023-01-01 00:00:00
end: 2023-09-03 00:00:00
period: 45m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("EMA-Cross-JC Intraday with Trailing SL", overlay=true)

// emabasel = input(100, "Base Length")
emaslen = input(15, "Slow Length")
emaflen = input(9, "Fast Length")
intra =input(true, title = "Intraday?")
sq_time_hr = input(15, title="Exit Hr")
sq_time_min = input(20, title="Exit Min")

emaslow = ta.ema(close, emaslen)
emafast = ta.ema(close, emaflen)
// emabase = ta.ema(close, emabasel)

emaup = ta.crossover(emafast, emaslow)
emadown = ta.crossunder(emafast, emaslow)

tsival = ta.tsi(close, 13, 55)

plot(emaslow, title="Slow EMA", color=color.yellow, linewidth=1)
plot(emafast, title="Fast EMA", color=color.green, linewidth=1)
// plot(emabase, title="Base EMA", color=color.white, linewidth=3)

takeProfitPoints = input(200, title="Take Profit")
// tp_off = input(4000, title="Keep trailing")
stopLossPoints = input(100, title="Stop Loss")

// Define the time to square off positions
squareOffTime = timestamp(year, month, dayofmonth, sq_time_hr, sq_time_min)

var float trailingStop = na

if emaup and barstate.isconfirmed and time < squareOffTime //and tsival >=0
    strategy.entry("Buy", strategy.long)
    strategy.exit("Sell", "Buy", stop=close - stopLossPoints, limit=close + takeProfitPoints)
    // trailingStop := emabase - stopLossPoints
    strategy.exit("Trailing Stop", "Buy", stop=trailingStop)

if emadown and barstate.isconfirmed and time < squareOffTime //and tsival <=0
    strategy.entry("Sell", strategy.short)
    strategy.exit("Cover", "Sell", stop=close + stopLossPoints, limit=close - takeProfitPoints)
    // trailingStop := emabase + stopLossPoints
    strategy.exit("Trailing Stop", "Sell", stop=trailingStop)

// Close any open positions before the end of the trading day
if ta.barssince(strategy.opentrades) == 0 and time >= squareOffTime and intra == true
    strategy.close_all()

// plot(tsival, title = "TSI Value")
plotshape(emaup and barstate.isconfirmed, title="Crossover", style = shape.triangleup , size=size.small,color = color.green, location = location.belowbar)
plotshape(emadown and barstate.isconfirmed, title="Crossunder",style = shape.triangledown, size=size.small,color = color.red, location = location.abovebar)


もっと