Tìm cơ hội cược BO với Trend line

Tìm cơ hội cược BO với Trend line

Tìm cơ hội cược BO với Trend line
e so lệnh với iq thì 3-0 bác ạ data ngày 18/2 backtest từ 10h sáng
4-1 òi nè
IMG_20200218_164600.jpg
 
Như thường lệ, có list đẹp mình lại khoe, rút kinh nghiệm ko tham, 4-1 là oke roài, chốt sổ :D Backtest của TradingView là 2-3 mới tài :D
chrome_c249UVB5wx.png
 
keke đen thoii đỏ quên đi đúng k bác cứ ăn dây bệt là đk:D
Thiệt tình chứ canh bệt là thích nhất, mà canh bệt phải dùng mắt, tay, chuột vì Bollinger bands khó mà chuyển thành code được. Phải canh thác nhỏ đi 1 mạch từ band này qua band kia bên trong band, rồi còn phải đợi nó bật ngược trở lại, bật trở lại xong còn phải đợi xem nó có cắn được band nào không, đến lúc đó mới dám theo bệt, ngồi đợi thôi là thấy nản ùi :D
 
@vĩnh0902 @Trương Nhật có đồ ngon là không thiếu phần anh em nhé, hệ thống Woodies CCI đáo hạn 30' này :D
Mã:
// BO - Woodies CCI - Backtesting
//anch.v43
// © inno14
//@version=4
strategy("BO - Woodies CCI - Backtesting", pyramiding=0)
// === INPUT PERIOD OF TIME ===
Date   = input(true, title = "=== Date Option ===")
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 = 2020, title = "From Year", minval = 2017)

ToDay     = input(defval = 1, title = "To Day", minval = 1, maxval = 31)
ToMonth   = input(defval = 1, title = "To Month", minval = 1, maxval = 12)
ToYear    = input(defval = 9999, title = "To Year", minval = 2017)

// === DATE RANGE ===
start     = timestamp(FromYear, FromMonth, FromDay, 00, 00)  // backtest start window
finish    = timestamp(ToYear, ToMonth, ToDay, 23, 59)        // backtest finish window
window()  => time >= start and time <= finish ? true : false // create function "within window of time"

// === Trading Time ===
CTimeDvM   = input(true, title = "=== Trading Time ===")
Time_zone = input(7,title="Time Zone")
FromHourDvM   = input(defval = 05, title = "From Hour", minval = 00, maxval = 23)
FromMinuteDvM = input(defval = 00, title = "From Minute", minval = 00, maxval = 59)
ToHourDvM   = input(defval = 04, title = "To Hour", minval = 00, maxval = 23)
ToMinuteDvM = input(defval = 59, title = "To Minute", minval = 00, maxval = 59)

GMT_FHDvM=FromHourDvM<Time_zone?FromHourDvM-Time_zone+24:FromHourDvM-Time_zone
GMT_THDvM=ToHourDvM<Time_zone?ToHourDvM-Time_zone+24:ToHourDvM-Time_zone
fhDvM= (GMT_FHDvM<10?"0"+tostring(GMT_FHDvM):tostring(GMT_FHDvM))
fmDvM= (FromMinuteDvM<10?"0"+tostring(FromMinuteDvM):tostring(FromMinuteDvM))
thDvM= (GMT_THDvM<10?"0"+tostring(GMT_THDvM):tostring(GMT_THDvM))
tmDvM= (ToMinuteDvM<10?"0"+tostring(ToMinuteDvM):tostring(ToMinuteDvM))
WorkingHourDvM = fhDvM+fmDvM+"-"+thDvM+tmDvM
t0_DvM = time(timeframe.period, WorkingHourDvM)
htrtime = input(true,title="Highlight Trading Time")
bgcolor(htrtime? t0_DvM? color.gray : na:na, title="Trading Time", transp=90)

//Woodies CCI
cciTurboLength = input(title="CCI Turbo Length", type=input.integer, defval=6, minval=3, maxval=14)
cci14Length = input(title="CCI 14 Length", type=input.integer, defval=14, minval=7, maxval=20)

source = close

cciTurbo = cci(source, cciTurboLength)
cci14 = cci(source, cci14Length)

last5IsDown = cci14[5] < 0 and cci14[4] < 0 and cci14[3] < 0 and cci14[2] < 0 and cci14[1] < 0
last5IsUp = cci14[5] > 0 and cci14[4] > 0 and cci14[3] > 0 and cci14[2] > 0 and cci14[1] > 0
histogramColor = last5IsUp ? color.green : last5IsDown ? color.red : cci14 < 0 ? color.gray : color.gray

//Plot Woodies CCI
plot(cci14, title="CCI Histogram", color=histogramColor, style=plot.style_histogram, linewidth=10, transp=0)
plot(0, title="Zero Line", color=cciTurbo>60?color.blue:cciTurbo<-60?color.red:color.navy, style=plot.style_line, linewidth=10, transp=0)
hline(200, title="Hundred Line", color=color.black, linestyle=hline.style_dotted)
hline(-200, title="Minus Line", color=color.black, linestyle=hline.style_dotted)

//Plot lingreg CCI14
linreg_cci14=linreg(cci14, 5, 0)
plot(linreg_cci14, color=color.aqua, linewidth=4)

//peak & top
peak_cci= linreg_cci14[1]>linreg_cci14[2] and linreg_cci14[0]<linreg_cci14[1] and linreg_cci14[1]>0
bott_cci= linreg_cci14[1]<linreg_cci14[2] and linreg_cci14[0]>linreg_cci14[1] and linreg_cci14[1]<0

//Entry
no_orders =
       not peak_cci[1]
       and not peak_cci[2]
       and not peak_cci[3]
       and not peak_cci[4]
       and not peak_cci[5]
       and not bott_cci[1]
       and not bott_cci[2]
       and not bott_cci[3]
       and not bott_cci[4]
       and not bott_cci[5]
//Put signal
x1=
       peak_cci and no_orders
       and cciTurbo[0]>=0
       and cci14[0]>=60

//Call signal
y1=
       bott_cci and no_orders
       and cciTurbo[0]<=0
       and cci14[0]<=-60



//Function
xTech=
       x1
      

yTech=
       y1
      

//Plot Analyzing Signals
//hline1=hline(-1.2*300)
hline2=hline(-1.6*300)
hline0=hline(0)
sigtext=
       xTech?"Put signal":yTech?"Call signal":
       "Backtesting From: "+tostring(FromDay)+"/"+tostring(FromMonth)+"/"+tostring(FromYear)+" To: "+tostring(ToDay)+"/"+tostring(ToMonth)+"/"+tostring(ToYear)
       + " * Trading Time From: "+tostring(FromHourDvM)+":"+tostring(FromMinuteDvM)+" To "+tostring(ToHourDvM)+":"+tostring(ToMinuteDvM)
sig_col=xTech?color.new(color.red,0):yTech?color.new(color.blue,0):color.new(color.navy,0)
label_sig_text = label.new(bar_index[0], -1.5*300, text=sigtext, style=label.style_none, textcolor=sig_col, size=size.large)
label.delete(label_sig_text[1])

//plot Signal
putcol = xTech? color.red : na
callcol = yTech? color.blue : na
PutSignal= xTech and window() and t0_DvM?-1.2*300:na
CallSignal= yTech and window() and t0_DvM?-1.2*300:na

//plot(PutSignal, title='Put Signal', style=plot.style_columns, color=color.red, offset=1, transp=0)
//plot(CallSignal, title='Call Signal', style=plot.style_columns, color=color.blue, offset=1, transp=0)
plotshape(PutSignal, title='Put', text="Put", style=shape.circle, location=location.absolute, color=color.red, textcolor=color.black, offset=1, transp=0, size=size.large)
plotshape(CallSignal, title='Call', text="Call", style=shape.circle, location=location.absolute, color=color.blue, textcolor=color.black, offset=1, transp=0, size=size.large)

//Backtesting
strategy.entry("Call", strategy.long, when=yTech and window() and t0_DvM)
strategy.entry("Put", strategy.short, when=xTech and window() and t0_DvM)
//strategy.close_all(when=barstate.isnew)
strategy.close_all(when=barssince(xTech)==6 or barssince(yTech)==6)
//EOF

=== Ảnh minh họa ===
chrome_xS2AdmCBFq.png
chrome_yFqv1bMPxL.png
 
@vĩnh0902 @Trương Nhật code backtest CCI trên là để kiểm tra sự hiệu quả của đường hồi quy đấy, và hệ thống này dùng để trade tay nhiều cặp. Rule rất đơn giản.
* Trong 1 xu hướng lên theo hệ thống woodies (6 thanh cci14 dương, tức thanh cci đã đổi màu xanh) thì khi đường hồi quy (dây màu xanh) tạo đáy là có thể mua vào.
* Trong 1 xu hướng giảm theo hệ thống woodies (6 thanh cci14 âm, tức thanh cci đã đổi màu đỏ) thì khi đường hồi quy (dây màu xanh) tạo đỉnh là có thể bán ra.
* Đường zero đổi màu theo CCI Turbo dùng để đo momentum.
 

BÌNH LUẬN MỚI NHẤT

  • captainfx trong Chuyện bên lề 529 Xem / 1 Trả lời
  • DuongHuy trong Phân tích Forex - Vàng - Hàng hóa 120 Xem / 6 Trả lời
  • TraderLC trong Hội Trader giao dịch Quỹ 2,216 Xem / 32 Trả lời
  • Mạc An trong Phân tích Forex - Vàng - Hàng hóa 231 Xem / 12 Trả lời
  • DuongHuy trong Phân tích Forex - Vàng - Hàng hóa 487 Xem / 38 Trả lời
  • AdBlock Detected

    We get it, advertisements are annoying!

    Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

    Back
    Bên trên