Chiến lược phá vỡ ARGO là một chiến lược giao dịch 4 giờ dựa trên phá vỡ kênh. Chiến lược này kết hợp các kênh Brinh và nguyên tắc phá vỡ để tạo ra tín hiệu giao dịch trong khoảng thời gian 4 giờ để nắm bắt biến động giá lớn hơn.
Chiến lược này bắt đầu bằng cách tính các mức giá cao nhất và thấp nhất trong một chu kỳ nhất định để tạo ra phạm vi kênh. Sau đó, tính các đường trung tâm của kênh và các đường Brinh trên và dưới đường của kênh.
Cụ thể, chiến lược đầu tiên tính giá upBound và giá downBound cao nhất trong vòng N chu kỳ ([ 47 chu kỳ mặc định]) để tạo ra đường biên trên và dưới của kênh. Sau đó, thiết lập một điểm lệch ([ 1 mặc định]) và Tol ([ 1000 mặc định]) và tính đường biên trên đường BoundUp và đường biên dưới đường BoundDown.
Ngoài ra, chiến lược này cũng đặt các điều kiện dừng lỗ. Mua dừng là gần đường ray dưới, bán dừng là gần đường ray trên. Đặt dừng là tỷ lệ lợi nhuận mục tiêu của đầu vào.
Chiến lược phá vỡ ARGO là một chiến lược giao dịch đường dài trung bình trong 4 giờ sử dụng kênh Brin và nguyên tắc phá vỡ. So với giao dịch đường ngắn, chiến lược này chú trọng hơn vào việc nắm bắt các điểm biến của xu hướng đường dài trung bình.
/*backtest
start: 2023-01-01 00:00:00
end: 2023-10-06 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
// strategy("ARGO_BAND-STRATEGY", overlay=true,default_qty_value=10000,scale=true,initial_capital=100,currency=currency.USD)
// A 4hours Breakout Strategy work in progres..it's a starting point, thanks to all tradingview community
//How to use: test it only on gbpjpy 240 min, wait the end of the candle to place next order, red and blue dots are short and long stop orders, Targets are Upper and lowerBands. Test it and enjoy but use at your own risk..
//2016 © F.Peluso
risk=input(title="Risk", defval=1)
length = input(title="Length", minval=1, maxval=1000, defval=47)
stopBound=input(title="Previous",defval=10)
upBound = highest(high, length)
downBound = lowest(low, length)
point=1
tol=1000
stopT=input(title="Stop", defval=5,minval=1, maxval=5)
dev =input(title="Tolerance",defval=2,minval=1, maxval=5)
limitBoundUp=( highest(high, length))*(point-(dev/tol))
limitBoundDown=downBound/(point-(dev/tol))
plot(limitBoundUp[1],linewidth = 3,style = circles, color = navy,trackprice=true),transp=0
plot(limitBoundDown[1],linewidth = 3,style = circles, color = red,trackprice=true,transp=0)
mezzalinea=((upBound+downBound)/2)
// Color Bands
colo = ((close>limitBoundUp[1]) ? blue : (close<upBound[1]) ? white : na)
UpB = plot(upBound[1], title="Upper Bound", style=linebr, linewidth=1, color=colo)
DownB = plot(limitBoundUp[1] ,title="Lower Bound", style=linebr, linewidth=2, color=colo)
fill(UpB, DownB, color=colo, transp=90)
plot(limitBoundUp[2]/(point+(stopT/tol)),color=colo)
coloS = ((close<limitBoundDown[1]) ? red : (close>downBound[1]) ? white : na)
DB = plot(downBound[1], title="Upper Bound", style=linebr, linewidth=1, color=coloS)
DoB = plot(limitBoundDown[1] ,title="Lower Bound", style=linebr, linewidth=2, color=coloS)
fill(DB, DoB, color=coloS, transp=90)
plot(limitBoundDown[2]*(point+(stopT/tol)),color=coloS)
// Strategy
past=input(title="Past", defval=5)
buy=(crossover(close,limitBoundUp))
closebuy=cross(high[past],upBound[0])
stopbuy = limitBoundUp[2]/(point+(stopT/tol))
sell=crossunder(close,limitBoundDown)
closesell=cross(low[past],downBound[0])
if (not na(close[length]))
if (buy)
strategy.entry("ChBrkLE", strategy.long,stop=limitBoundUp - syminfo.mintick,comment="Long I")
strategy.close("ChBrkLE",when=closebuy)
if (not na(close[length]))
if (sell)
strategy.entry("ChBrkSE", strategy.short,stop=limitBoundDown + syminfo.mintick,comment="Short I")
strategy.close("ChBrkSE",when=closesell)
Target =input(0) * 10
Stop = input(90) * 10
Trailing = input(40) * 10
CQ = 100
TPP = (Target > 0) ? Target : na
SLP = (Stop > 0) ? Stop : na
TSP = (Trailing > 0) ? Trailing : na
strategy.exit("Out Short", "ChBrkSE", qty_percent=CQ, profit=TPP, loss=SLP, trail_points=TSP)
strategy.exit("Out Long", "ChBrkLE", qty_percent=CQ, profit=TPP, loss=SLP, trail_points=TSP)
//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)