이 전략은 오픈 상장 전 시점에 초점을 맞추고, 평균선과 동력 지표와 결합하여 단기 경향을 판단하고, 높은 동력 단계에서 돌파 거래를 한다. 전형적인 단선 중개 전략에 속한다.
전략적 원칙:
1시간 이내에 거래할 수 있도록 설정합니다.
50주기 EMA를 계산하여 대시장 합리적인 가격대를 판단한다.
SMI 지표가 지역 하위에서 상향으로 교차하는 것은 구매 신호로 간주한다.
EMA 평균선을 돌파한 종결 가격은 스톱로스 신호로 간주한다.
고정 정지점을 설정하고, 목표 짧은 라인을 조정한다.
이 전략의 장점:
단기 EMA를 뚫고, 그 날의 트렌드 방향을 판단할 수 있다.
SMI 지표는 과매도 지역에서 역전 가능성이 있음을 확인한다.
리포트 파라미터가 제한되어 있고, 실 디스크는 조작이 쉽다.
이 전략의 위험은:
횡단으로 넘어간 경우, 횡단선 앞에 있는 틈새를 형성할 수 있으며, 틈새를 뒤집을 때 주의해야 한다.
하루 동안의 운용으로, 비행에 대처하기 힘들다.
정지폭이 작고, 조정이 적절하지 않아 손해가 발생한다.
요약하자면, 이 전략은 전형적인 상반기 전의 짧은 라인 전략으로, EMA와 SMI 지표를 통해 높은 동력의 돌파구를 추구하고 있다. 그러나 상반기 전의 금고 위험은 높으며, 포지션을 제어하고 손해를 막아야 한다.
/*backtest
start: 2022-09-12 00:00:00
end: 2023-09-12 00:00:00
period: 4d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
args: [["v_input_7",65]]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Trading_Bites
//@version=5
// strategy('Morning Scalp', overlay=false, pyramiding=2, initial_capital=3000, default_qty_value=0, commission_value=0.02, max_labels_count=500)
// Initial Inputs
StartDate = timestamp('15Aug 2022 14:00 +0000')
EndDate = timestamp('15Aug 2022 20:00 +0000')
testPeriodStart = input(StartDate, 'Start of trading')
testPeriodEnd = input(EndDate, 'End of trading')
QuantityOnLong = input(title="Quantity", defval=100, minval=1)
QuantityOnClose = QuantityOnLong
//////////////////////////////////////////////////////////////////////
//-- Time In Range
timeinrange(res, sess) =>
not na(time(res, sess))
//Market Open//
marketopen = '0930-1600'
MarketOpen = timeinrange(timeframe.period, marketopen)
//////////////////////////////////////////////////////////////////////
//Market Hour//
morning = '1000-1210'
Morning = timeinrange(timeframe.period, morning)
//////////////////////////////////////////////////////////////////////////
//STOCK MOMENTUM INDEX//
a = input(5, 'Percent K Length')
b = input(3, 'Percent D Length')
ovrsld = input.float(40, 'Over Bought')
ovrbgt = input(-40, 'Over Sold')
//lateleave = input(14, "Number of candles", type=input.integer)
// Range Calculation
ll = ta.lowest(low, a)
hh = ta.highest(high, a)
diff = hh - ll
rdiff = close - (hh + ll) / 2
// Nested Moving Average for smoother curves
avgrel = ta.ema(ta.ema(rdiff, b), b)
avgdiff = ta.ema(ta.ema(diff, b), b)
// SMI calculations
SMI = avgdiff != 0 ? avgrel / (avgdiff / 2) * 100 : 0
SMIsignal = ta.ema(SMI, b)
CrossoverIndex = ta.crossover(SMI, SMIsignal)
CrossunderIndex = ta.crossunder(SMI, SMIsignal)
plot1 = plot(SMI, color=color.new(color.aqua, 0), title='Stochastic Momentum Index', linewidth=1, style=plot.style_line)
plot2 = plot(SMIsignal, color=color.new(color.red, 0), title='SMI Signal Line', linewidth=1, style=plot.style_line)
hline = plot(ovrsld, color=color.new(color.red, 0), title='Over Bought')
lline = plot(ovrbgt, color=color.new(color.green, 0), title='Over Sold')
plot(CrossoverIndex ? close : na, color=color.new(color.aqua, 0), style=plot.style_cross, linewidth=2, title='RSICrossover')
mycol1 = SMIsignal > -ovrbgt ? color.red : na
mycol2 = SMIsignal < -ovrsld ? color.green : na
fill(plot1, hline, color=color.new(mycol1, 80))
fill(plot2, lline, color=color.new(mycol2, 80))
//////////////////////////////////////////////////////////////////////
// Input EMA9 and EMA21
EMA50Len = input( 50 )
EMA50 = ta.ema(close, EMA50Len)
//////////////////////////////////////////////////////////////////////////
// -------- VWAP ----------//
vwapLine = ta.vwap(close)
////////////////////////////////////////////////////////////////////////
//PROFIT TARGET//
longProfitPer = input(10.0, title='Take Profit %') / 100
TargetPrice = strategy.position_avg_price * (1 + longProfitPer)
//plot (strategy.position_size > 0 ? TargetPrice : na, style=plot.style_linebr, color=color.green, linewidth=1, title="Price Target")
//BUY STRATEGY CONDITION//
condentry = ta.crossover(SMI, SMIsignal) and SMI < 0
profittarget = TargetPrice
stoploss = close < EMA50
///////////////////////////STRATEGY BUILD//////////////////////////////////////
if MarketOpen
if close > EMA50
if (condentry) and Morning
strategy.entry('Long', strategy.long)
if profittarget and strategy.position_size > 0
strategy.exit(id="Long", limit=TargetPrice)
if stoploss
strategy.close('Long' )