EMA-Cross-JC Intraday와 트레이링 SL

저자:차오장, 날짜: 2023-09-04 15:39:54
태그:

트래일링 SL 전략과 함께 EMA-Cross-JC Intraday

EMA-Cross-JC Intraday with Trailing SL 전략은 거래 기회를 식별하기 위해 기하급수적인 이동 평균 (EMA) 을 사용하는 기술적 거래 전략이다. 이 전략은 Intraday 시간 프레임에서 사용할 수 있도록 설계되었으며, 긴 포지션과 짧은 포지션을 거래하는 데 사용할 수 있습니다.

이 전략은 빠른 EMA와 느린 EMA 사이의 교차점을 식별하여 작동합니다. 빠른 EMA가 느린 EMA를 넘을 때 구매 신호가 생성됩니다. 빠른 EMA가 느린 EMA를 넘을 때 판매 신호가 생성됩니다.

이 전략은 또한 리스크를 관리하기 위해 트레일링 스톱 로스를 사용합니다. 트레일링 스톱 로스는 자산의 가격이 거래자의 유리한 방향으로 움직일 때 상승하는 동적 스톱 로스입니다. 이는 거래자의 손실이 제한되어 있는지 확인하는 데 도움이됩니다. 동시에 가능한 한 많은 잠재적 이익에 참여할 수 있습니다.

EMA-Cross-JC Intraday with Trailing SL 전략은 사용하기에는 비교적 간단한 전략이지만 매우 효과적일 수 있습니다. 전략은 건전한 기술적 원리에 기초하고 있으며 시간이 지남에 따라 수익성이 입증되었습니다.

다음은 EMA-Cross-JC Intraday with Trailing SL 전략을 사용하는 몇 가지 장점입니다.

그것은 사용하기 쉬운 전략으로 모든 경험 수준의 거래자에게 접근 할 수 있습니다. 그것은 건전한 기술적 원칙에 기초하고 있으며, 이는 성공 가능성이 높다는 것을 의미합니다. 리스크를 관리하기 위해 트레이닝 스톱 로스를 사용하며, 이는 트레이더를 큰 손실으로부터 보호하는 데 도움이 됩니다. 그것은 다재다능한 전략을 만들기 위해 긴 및 짧은 포지션을 거래하는 데 사용할 수 있습니다. 다음은 EMA-Cross-JC Intraday with Trailing SL 전략을 사용하는 것과 관련된 몇 가지 위험입니다.

이 전략은 역사적인 가격 데이터에 기초하고 있으며, 미래에 수익성이 보장되지 않습니다. 이 전략은 윙사 (whipsaw) 에 민감할 수 있습니다. 즉 자산의 가격이 두 방향으로 빠르게 움직일 때입니다. 이 전략은 변동적이기도 하고, 큰 손실의 위험이 있다는 것을 의미합니다. 전반적으로, 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)


더 많은