[Backtest] Chiến lược Novecento - cũ mà mới.

[Backtest] Chiến lược Novecento - cũ mà mới.

[Backtest] Chiến lược Novecento - cũ mà mới.
@vĩnh0902 test lại cái này 2 tháng xem, keke, vốn lớn tính kelly đi chiến lược này ổn áp :D
Mã:
//@version=4
//Bo Novecento M5
//author: anhnguyen14

strategy(title="Bo Novecento M5", overlay=true, pyramiding=14)

// === INPUTS

setup1=input(true, title="Novecentas Setup")
// - /INPUTS

//The Vostro Indicator
period156 = 100
level = input(8, title="Vostro Level")
gd120 = sum(hl2, 5)
gd128 = gd120 * .2
gd121 = sum(high - low, 5)
gd136 = gd121 * .2 * .2

ibuff116 = (low - gd128) / gd136
ibuff112 = (high - gd128) / gd136


ibuff108 = iff(ibuff112 > level and high > wma(hl2, period156), 90, iff(ibuff116 < -level and low < wma(hl2, period156), -90, 0))
ibuff109 = iff(ibuff112 > level and ibuff112[1] > level or ibuff116 < -level and ibuff116[1] < -8, 0, ibuff108)
//plot(ibuff109, color=color.blue, linewidth=2)
//plot(80)
//plot(-80)

//Trend Direction Force Index
filterHigh = 0.5
filterMid = 0
filterLow = -0.5
price = close

//TFD5
lookback5 = input(5, title="TDF Fast")
mma5 = ema(price * 1000, lookback5)
smma5 = ema(mma5, lookback5)

impetmma5 = mma5 - mma5[1]
impetsmma5 = smma5 - smma5[1]
divma5 = abs(mma5 - smma5)
averimpet5 = (impetmma5 + impetsmma5) / 2

number5 = averimpet5
pow5 = 3
result5 = float(na)

for i = 1 to pow5 - 1 by 1
    if i == 1
        result5 := number5
        result5
    result5 := result5 * number5
    result5

tdf5 = divma5 * result5
ntdf5 = tdf5 / highest(abs(tdf5), lookback5 * 3)

//c = ntdf5 > filterHigh ? color.green : ntdf < filterLow ? color.red : color.gray
//plot(ntdf5, linewidth=3, color=color.red)

//TFD20
lookback20 = input(20, title="TDF Slow")
mma20 = ema(price * 1000, lookback20)
smma20 = ema(mma20, lookback20)

impetmma20 = mma20 - mma20[1]
impetsmma20 = smma20 - smma20[1]
divma20 = abs(mma20 - smma20)
averimpet20 = (impetmma20 + impetsmma20) / 2

number20 = averimpet20
pow20 = 3
result20 = float(na)

for i = 1 to pow20 - 1 by 1
    if i == 1
        result20 := number20
        result20
    result20 := result20 * number20
    result20

tdf20 = divma20 * result20
ntdf20 = tdf20 / highest(abs(tdf20), lookback20 * 3)

//c = ntdf5 > filterHigh ? color.green : ntdf < filterLow ? color.red : color.gray
//plot(ntdf20, linewidth=3, color=color.yellow)

//hline(filterHigh, color=color.black)
//hline(filterMid, color=color.black)
//hline(filterLow, color=color.black)


//Barry Support & Resistance
FractalLen=3
isFractal(x) => highestbars(x,FractalLen*2+1)==-FractalLen
sF=isFractal(-low), support=low, support:=sF ? low[FractalLen] : support[1]
rF=isFractal(high), resistance=high, resistance:=rF ? high[FractalLen] : resistance[1]
//plot(series=support, title="Support", color=color.blue, offset=-FractalLen)
//plot(series=resistance, title="Resistance", color=color.red, offset=-FractalLen)
plotshape(sF, title="Lower fractal", style=shape.diamond, location=location.belowbar, color=color.black, offset=-FractalLen, size=size.tiny)
plotshape(rF, title="Upper fractal", style=shape.diamond, location=location.abovebar, color=color.black, offset=-FractalLen, size=size.tiny)

//Put Condition

//Novecento M5 - Put Condition - Novecentas Setup
x1=
       setup1?
       ibuff109>80
       and ntdf5==1
       and ntdf20<0.5
       :false


//Novecento M5 - Call Condition - Novecentas Setup
y1=
       setup1?
       ibuff109<-80
       and ntdf5==-1
       and ntdf20>-0.5
       : false


// - /FUNCTIONS

x=
       x1
y=
       y1
    
//--------------------------------------\\

// Alert
putcol = x ? color.red : na
callcol = y ? color.blue : na
bgcolor(putcol, transp=70, offset=1, title="Put Signal For Macro (A)")
bgcolor(callcol, transp=70, offset=1, title="Call Signal For Macro (A)")

strategy.entry("Call", strategy.long, when=(y))

strategy.entry("Put", strategy.short, when=(x))

strategy.close_all(when=barstate.isnew)

  
//EOF
Code này nè @vĩnh0902
 
upload_2019-12-26_8-45-21.png
cái này đk trước hinh như đk ghep zo bộ BO m5 đúng k bác nhỉ
 
Khung giờ vào lệnh nó trải rộng quá, và cực ít lệnh nên ko ghép đc. Nếu mình mà xoay đc tiền điện và khấu hao đc pc thì cắm máy 24/24 suốt năm một chiến lược duy nhất này, kaka, hết năm đổi máy mới :D
e cung nghĩ z kaka e cung đang định xoay tiền mua 1 con pc mới mà k biêt mua thê nào cho tốt bác gợi ý giúp e máy nào chạy macro ngon dk k ạ hjhj e k giỏi vê pc mấy hjhj:D
 
e cung nghĩ z kaka e cung đang định xoay tiền mua 1 con pc mới mà k biêt mua thê nào cho tốt bác gợi ý giúp e máy nào chạy macro ngon dk k ạ hjhj e k giỏi vê pc mấy hjhj:D
Cái này phải hỏi mấy anh hardware ấy :D
Nói đùa thôi, chứ chơi kiểu ấy cũng khó, tốt nhất là trade có thời gian cụ thể á và khoảng 8 tiếng/ngày thôi :D
À, cái đồng hồ TradingView mình chưa bỏ đâu nha, lát test giùm mình nha. Cái đó mới là cái trade lâu dài đấy :D
 
2 tháng đây bác ơi hjhj
upload_2020-1-8_20-17-40.png

usdjpy
upload_2020-1-8_20-21-33.png

EJ
upload_2020-1-8_20-23-46.png

AJ
upload_2020-1-8_20-23-57.png
 

Đính kèm

  • upload_2020-1-8_20-23-24.png
    upload_2020-1-8_20-23-24.png
    194.7 KB · Xem: 4
Chỉnh sửa lần cuối:

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

  • Quíc Óp trong Phân tích Forex - Vàng - Hàng hóa 180 Xem / 10 Trả lời
  • Mạc An trong Phân tích Forex - Vàng - Hàng hóa 576 Xem / 28 Trả lời
  • DuongHuy trong Phân tích Forex - Vàng - Hàng hóa 327 Xem / 31 Trả lời
  • Bianas trong Phân tích Forex - Vàng - Hàng hóa 92 Xem / 3 Trả lời
  • Huan2051 trong Phân tích Forex - Vàng - Hàng hóa 294,726 Xem / 1,397 Trả lời
  • Mạc An trong Phân tích Forex - Vàng - Hàng hóa 1,316 Xem / 58 Trả lời
  • DuongHuy trong Phân tích Forex - Vàng - Hàng hóa 417 Xem / 24 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