런던 브레이크아웃 단기 트레이딩 전략


생성 날짜: 2023-09-15 15:43:04 마지막으로 수정됨: 2023-09-15 15:43:04
복사: 0 클릭수: 826
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

전략 개요

런던 브레이크 쇼트 라인 거래 전략은 외환 시장을 대상으로 설계된 일일 거래 전략으로, 런던 거래 시간대의 가격 행태를 활용하여 간단한 브레이크 판단을 통해 거래 신호를 생성한다. 이 전략은 특정 거래 시간 및 가격 행동 특성을 결합하여 단선을 추구한다.

전략 원칙

  1. 평일 런던 시간대에만 거래, 예를 들어 GMT 0400-0500。

  2. 가격의 단기 경향을 판단하라: 3개의 K선 연속 상승이 더 많고, 3개의 K선 연속 하락이 더 적다.

  3. 더 많은 신호: 세 개의 K 선이 나타나면 더 많은 신호를 입력하십시오.

  4. 공백 신호: 3개의 하락 K 라인이 나타나면 진입 공백한다.

  5. 스톱로스: 입점 가격의 일정한 비율을 스톱로스 스톱로스로 설정한다.

  6. 출전 규칙: 정지 또는 정지 트리거 이후 출전; 또는 런던 시간이 끝난 후 출전.

이 전략은 간단한 돌파 신호 캡처 트렌드만을 이용하고, 각 거래의 위험과 수익률을 통제하기 위해 엄격한 자금 관리를 지원합니다.

전략적 이점

  • 런던에서 가장 활발한 시간대에만 거래합니다.

  • 간단한 가격 돌파구 판단 신호

  • 엄격한 스톱 손실 제어 위험

  • 야간 클럽과 휴일 유동성이 없는 시기를 피하십시오.

  • 명확한 입출장 규칙

위험 경고

  • 너무 일찍 또는 너무 늦게 접근할 수 있는 문제

  • 리베이트의 위험

  • 야간이나 휴일에도 거래 기회가 있을 수 있습니다.

  • 중요한 지지 저항 지점에 주의를 기울여야 합니다.

요약하다

런던의 돌파구 단선 거래 전략은 낮의 단선 운영에 매우 적합하며, 시장의 혼돈의 시간을 회피하고, 높은 유동의 단계에서 이익을 얻을 수 있다. 파라미터를 조정하여 더 많은 품종에 적응할 수 있으며, 효과적인 단선 거래 전략이다.

전략 소스 코드
/*backtest
start: 2023-09-07 00:00:00
end: 2023-09-08 09:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("time zone", overlay=true, initial_capital=1000)
fromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
fromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)
fromYear = input(defval = 2000, title = "From Year", minval = 1970)
 //monday and session 
// To Date Inputs
toDay = input(defval = 31, title = "To Day", minval = 1, maxval = 31)
toMonth = input(defval = 12, title = "To Month", minval = 1, maxval = 12)
toYear = input(defval = 2020, title = "To Year", minval = 1970)

startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00)
finishDate = timestamp(toYear, toMonth, toDay, 00, 00)
time_cond = true

s = input(title="Session", type=input.session, defval="0400-0500")
s2 = input(title="eXOT", type=input.session, defval="0300-0900")
t1 = time(timeframe.period, s)
t2 = time(timeframe.period, s2)
c2 = #0000FF
//bgcolor(t1 ? c2 : na, transp=85)

UseHAcandles    = input(false, title="Use Heikin Ashi Candles in Algo Calculations")
//
// === /INPUTS ===

// === BASE FUNCTIONS ===

haClose = UseHAcandles ? security(heikinashi(syminfo.tickerid), timeframe.period, close) : close
haOpen  = UseHAcandles ? security(heikinashi(syminfo.tickerid), timeframe.period, open) : open
haHigh  = UseHAcandles ? security(heikinashi(syminfo.tickerid), timeframe.period, high) : high
haLow   = UseHAcandles ? security(heikinashi(syminfo.tickerid), timeframe.period, low) : low

isMon() => dayofweek(time('D')) == dayofweek.monday
isTue() => dayofweek(time('D')) == dayofweek.tuesday
isWed() => dayofweek(time('D')) == dayofweek.wednesday
isThu() => dayofweek(time('D')) == dayofweek.thursday
isFri() => dayofweek(time('D')) == dayofweek.friday
isSat() => dayofweek(time('D')) == dayofweek.saturday
isSun() => dayofweek(time('D')) == dayofweek.sunday

longe = input(true, title="LONG only")
shorte = input(true, title="SHORT only")
//sl=input(0.001, title="sl % price movement")
//accbalance = strategy.initial_capital + strategy.netprofit


entry = close

sl = input(0.005, title = "Stop Loss")
tp = input(0.005, title="Target Price")

// sldist = entry - sl
// tgdist = tp - entry 
// slper = sldist / entry * 100
// tgper = tgdist / entry * 100

// rr = tgper / slper
// size = accbalance * riskper / slper

balance = strategy.netprofit + 50000 //current balance
floating = strategy.openprofit          //floating profit/loss
risk = input(1,type=input.float,title="Risk % of equity ")           //risk % per trade


temp01 = (balance * risk)/100     //Risk in USD
temp02 = temp01/close*sl      //Risk in lots
temp03 = temp02*100000      //Convert to contracts
size = temp03 - temp03%1000 //Normalize to 1000s (Trade size)
if(size < 1000)
    size := 1000           //Set min. lot size



longC =  haClose> haClose[1] and  haClose[1] > haClose[2]  and haClose[2] <  haClose[3] 
shortC = haClose < haClose[1] and   haClose[1] < haClose[2]  and haClose[2] > haClose[3] 


luni = input(true, title="Monday")
marti = input(true, title="Tuesday")
miercuri = input(true, title="Wednesday")
joi = input(true, title="Thursday")
vineri = input(true, title="Friday")
if(time_cond)
    if(t1)
        if(luni==true and dayofweek == dayofweek.monday)
            if(longC and longe )
                strategy.entry("long",1)
            if(shortC and shorte)
                strategy.entry("short",0)
                
        if(marti==true and dayofweek == dayofweek.tuesday)
            if(longC and longe )
                strategy.entry("long",1)
            if(shortC and shorte)
                strategy.entry("short",0)
                
        if(miercuri==true and dayofweek == dayofweek.wednesday)
            if(longC and longe  )
                strategy.entry("long",1)
            if(shortC and shorte)
                strategy.entry("short",0)
                
        if(joi==true  and dayofweek == dayofweek.thursday)
            if(longC and longe)
                strategy.entry("long",1)
            if(shortC and shorte)
                strategy.entry("short",0)
                
        if(vineri==true and  dayofweek == dayofweek.friday)
            if(longC and longe)
                strategy.entry("long",1 )
            if(shortC and shorte)
                strategy.entry("short",0)  


//strategy.exit("closelong", "RSI_BB_LONG" , profit = close * 0.01 / syminfo.mintick, loss = close * 0.01 / syminfo.mintick, alert_message = "closelong")
//strategy.exit("closeshort", "RSI_BB_SHORT" , profit = close * 0.01 / syminfo.mintick, loss = close * 0.01 / syminfo.mintick, alert_message = "closeshort")

strategy.exit("sl","long", loss = close * sl / syminfo.mintick, profit = close * tp / syminfo.mintick)
strategy.exit("sl","short", loss=close * sl / syminfo.mintick, profit = close * tp / syminfo.mintick)

//strategy.close("long")
//strategy.close("short" )

//strategy.exit("sl","long", loss = sl)
//strategy.exit("sl","short", loss= sl)

if(not t2)
    strategy.close_all()
//strategy.risk.max_intraday_filled_orders(2)