Chiến lược giao dịch ngắn hạn London Breakout


Ngày tạo: 2023-09-15 15:43:04 sửa đổi lần cuối: 2023-09-15 15:43:04
sao chép: 0 Số nhấp chuột: 826
1
tập trung vào
1617
Người theo dõi

Tổng quan về chiến lược

Chiến lược giao dịch phá vỡ đường ngắn London là một chiến lược giao dịch trong ngày được thiết kế cho thị trường ngoại hối, nó sử dụng đặc biệt các hoạt động giá trong thời gian giao dịch ở London để tạo ra tín hiệu giao dịch thông qua các phán đoán phá vỡ đơn giản. Chiến lược này kết hợp các đặc điểm giao dịch và hành vi giá cụ thể, theo đuổi lợi nhuận ngắn.

Nguyên tắc chiến lược

  1. Chỉ giao dịch trong giờ London trong ngày làm việc, ví dụ như GMT 0400-0500.

  2. Xác định xu hướng ngắn hạn của giá: ba đường K liên tục tăng và tăng, ba đường K liên tục giảm và giảm.

  3. Tạo nhiều tín hiệu: Tạo nhiều tín hiệu khi có ba đường K trên.

  4. Tín hiệu trống rỗng: Khi có ba đường K giảm, hãy vào trống rỗng.

  5. Stop Loss: Đặt một phần trăm giá vào là Stop Loss.

  6. Quy tắc ra sân: ra sân sau khi kích hoạt dừng hoặc dừng; hoặc ra sân sau khi kết thúc giờ London.

Chiến lược này chỉ sử dụng các tín hiệu đột phá đơn giản để nắm bắt xu hướng đường ngắn, và sau đó kết hợp với quản lý tiền nghiêm ngặt để kiểm soát rủi ro và tỷ lệ lợi nhuận của mỗi giao dịch.

Lợi thế chiến lược

  • Chỉ giao dịch vào thời điểm hoạt động cao ở London

  • Đơn giản chỉ là dấu hiệu đánh giá đột phá

  • Kiểm soát rủi ro dừng lỗ nghiêm ngặt

  • Tránh các buổi tối và các ngày lễ không lưu động

  • Quy tắc nhập cảnh và xuất cảnh rõ ràng

Cảnh báo rủi ro

  • Có thể có vấn đề về nhập cảnh quá sớm hoặc quá muộn

  • Rủi ro bị lợi nhuận

  • Các cơ hội giao dịch có thể xuất hiện vào các ngày nghỉ và đêm giao dịch.

  • Cần chú ý đến ngưỡng kháng cự hỗ trợ quan trọng

Tóm tắt

Chiến lược giao dịch đường ngắn đột phá của London rất phù hợp cho hoạt động đường ngắn trong ngày, có thể tránh thời gian hỗn loạn của thị trường và kiếm lợi nhuận trong giai đoạn lưu động cao. Có thể điều chỉnh các tham số để phù hợp với nhiều giống hơn, là một chiến lược giao dịch đường ngắn hiệu quả.

Mã nguồn chiến lược
/*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)