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
Sửa 2 dòng này
Mã:
//strategy.close_all(when=barstate.isnew)
strategy.close_all(when=barssince(xTech)==6 or barssince(yTech)==6)
thành 2 dòng này là đáo hạn 1 nến nè :D
Mã:
strategy.close_all(when=barstate.isnew)
//strategy.close_all(when=barssince(xTech)==6 or barssince(yTech)==6)
dk rồi bác hjhj đổi cái winrate k đk như ý chán luôn keke:D:D
 
đổi cái Turbo Length thành 7. Thời gian từ 10h-22h55. cũng ổn. Chỉ là không có sàn đánh
tháng 1
upload_2020-2-21_16-41-19.png

từ đầu tháng 2
upload_2020-2-21_16-42-6.png
 
hiện h e vẫn mông lug chưa biêt theo chiến thuật nào để trade hic. nay e ngồi đọc lại bài của idol hubba mà ngại quay lại dùng mt4 quá huhu. loanh quanh trong đầu 1 mớ hỗn độn k biêt bắt đầu từ đâu. :mad::mad: xin bác cho e chút lời khuyên @anhnguyen14 @Trương Nhật
- Có những code triển vọng là code Novenceto, tuy nhiên lại ít lệnh, hiện tại sác xuất của tháng 2 là không quả quan lắm 50%
- Code tiếp theo là code Vostro nhưng thông số 9, cũng ít lệnh, hiệu suất tháng 2 vẫn chưa cao lắm
Không biết 2 code này bị gì mà qua t2 lại hơi thấp
- Code làm thất vọng nhất là code TDF... tháng 12 hơn 75%, tháng 1 hơn 65%...qua tháng 2 lại dính chuổi lost 9 lệnh liên tiếp. Nên việc demo hơn 2 tháng là khá quan trọng( Cái này cũng đúng với mấy code trong quá khứ luôn).
- Code đang tiềm năng là code BO-Bar's body extreme with signal. Chỉnh lại khoảng 200. hiệu suất tháng 1 là 62.5%, tháng 2 chắc hơn 70%...Rất đáng theo dõi demo thêm. Code này thì đánh con EJ cũng ổn luôn. Cơ số lệnh cũng tầm 25-30 lệnh 1 tháng
- Code tiềm năng tiếp theo là code bác @anhnguyen14 mới post. Có điều phải chơi ở sàn khác. Ví dụ olymtrade chẳng hạn.
 
- Có những code triển vọng là code Novenceto, tuy nhiên lại ít lệnh, hiện tại sác xuất của tháng 2 là không quả quan lắm 50%
- Code tiếp theo là code Vostro nhưng thông số 9, cũng ít lệnh, hiệu suất tháng 2 vẫn chưa cao lắm
Không biết 2 code này bị gì mà qua t2 lại hơi thấp
- Code làm thất vọng nhất là code TDF... tháng 12 hơn 75%, tháng 1 hơn 65%...qua tháng 2 lại dính chuổi lost 9 lệnh liên tiếp. Nên việc demo hơn 2 tháng là khá quan trọng( Cái này cũng đúng với mấy code trong quá khứ luôn).
- Code đang tiềm năng là code BO-Bar's body extreme with signal. Chỉnh lại khoảng 200. hiệu suất tháng 1 là 62.5%, tháng 2 chắc hơn 70%...Rất đáng theo dõi demo thêm. Code này thì đánh con EJ cũng ổn luôn. Cơ số lệnh cũng tầm 25-30 lệnh 1 tháng
- Code tiềm năng tiếp theo là code bác @anhnguyen14 mới post. Có điều phải chơi ở sàn khác. Ví dụ olymtrade chẳng hạn.
nhiều code qua loạn mất bác ạ hjhj cơ mà k có việc gi để làm test các code cũng zui kaka. mà demo thiệt sự k có tí cảm xúc nào cả sag tuần e phải real mới dk.
 
nhiều code qua loạn mất bác ạ hjhj cơ mà k có việc gi để làm test các code cũng zui kaka. mà demo thiệt sự k có tí cảm xúc nào cả sag tuần e phải real mới dk.
demo đi bác, như con TDF tui thấy hiệu suất 2 tháng trước oke, khi nó 5 lệnh thua liên tiếp rùi, tui bay vô đánh real, cứ nghĩ nó sẽ win...nhưng không... thua tiếp 4 lệnh. Mất tiền oan :D
 
demo đi bác, như con TDF tui thấy hiệu suất 2 tháng trước oke, khi nó 5 lệnh thua liên tiếp rùi, tui bay vô đánh real, cứ nghĩ nó sẽ win...nhưng không... thua tiếp 4 lệnh. Mất tiền oan :D
kaka cứ real la z ý mà bác:D. demo tiếp lại thấy t màu hồng lại tiếc là k phải real khi real lại toàn lệnh màu đỏ thật kaka
 
@vĩnh0902 @Trương Nhật cuối tuần chơi lầy với ông ma kẹt, ổng nhất quyết không cho mình take profit, hehehe, code woodies version cũ ấy, nó nhiều lệnh. ko biết nó trôi đằng nào rồi thôi mình đăng lại luôn. list hôm nay không đẹp, 5-4, nhưng mình đăng list luôn để biết độ lầy của ông ma kẹt :D
=== Ảnh backtest + list 21/2/2020 ===
chrome_2L7Iva0kAa.png

=== Code Signal của Woodies CCI - version cũ ===
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 = 07, title = "From Hour", minval = 00, maxval = 23)
FromMinuteDvM = input(defval = 00, title = "From Minute", minval = 00, maxval = 59)
ToHourDvM   = input(defval = 19, title = "To Hour", minval = 00, maxval = 23)
ToMinuteDvM = input(defval = 00, 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=40)
plot(0, title="Zero Line", color=cciTurbo>100?color.blue:cciTurbo<-100?color.red:color.navy, style=plot.style_line, linewidth=10, transp=20)
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[2]>linreg_cci14[3] and linreg_cci14[1]>linreg_cci14[2] and linreg_cci14[0]<linreg_cci14[1] and linreg_cci14[0]>0
bott_cci= linreg_cci14[2]<linreg_cci14[3] and linreg_cci14[1]<linreg_cci14[2] and linreg_cci14[0]>linreg_cci14[1] and linreg_cci14[0]<0


//Put signal
x1=
       peak_cci
       and cci14[1]>100
       and cci14[2]>100
       and cciTurbo[3]>100

//Call signal
y1=
       bott_cci
       and cci14[1]<-100
       and cci14[2]<-100
       and cciTurbo[3]<-100


no_orders =
       not x1[1]
       and not x1[2]
       and not x1[3]
       and not x1[4]
       and not x1[5]
       and not y1[1]
       and not y1[2]
       and not y1[3]
       and not y1[4]
       and not y1[5]

//Function
xTech=
       x1 and no_orders
    

yTech=
       y1 and no_orders
    

//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,10):yTech?color.new(color.blue,10):color.new(color.navy,10)
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
 
@vĩnh0902 @Trương Nhật hàng cho tuần mới
=== Ảnh hiệu suất ===
chrome_1HiCG3woSF.png
chrome_Eo6Xj9YuO1.png


=== Code ===
Mã:
// BO - Woodies CCI with RSI Filter- 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 = 07, title = "From Hour", minval = 00, maxval = 23)
FromMinuteDvM = input(defval = 00, title = "From Minute", minval = 00, maxval = 59)
ToHourDvM   = input(defval = 19, title = "To Hour", minval = 00, maxval = 23)
ToMinuteDvM = input(defval = 00, 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)

//RSI value
rsitt=input(true,title="=== RSI Filter ===")
src = close, len = input(17, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

//RSI Extreme
top_ext=round(highest(rsi[1],len)/2)
bot_ext=-top_ext
ext_col=color.new(color.aqua,10)
//plot(top_ext, title="Top Extreme", linewidth=2, color=ext_col, style=plot.style_stepline)
//plot(bot_ext, title="Bottom Extreme", linewidth=2, color=ext_col, style=plot.style_stepline)

//RSI Bar
rsi_val =rsi-50
rsi_bar_up = rsi_val>0?rsi_val:na
rsi_bar_dn = rsi_val<0?rsi_val:na
bar_up_col=color.new(color.blue,50)
bar_dn_col=color.new(color.red,50)
//plot(rsi_bar_up, title="RSI Upward", style=plot.style_columns, color=bar_up_col)
//plot(rsi_bar_dn, title="RSI Downward", style=plot.style_columns, color=bar_dn_col)

//Over Extreme Arrow
over_arrow=input(true,title="Enable Over Extreme Arrow")
over_ext_col=color.new(color.navy,10)
over_top_val= rsi_val>top_ext
over_bot_val= rsi_val<bot_ext
//plotshape(over_top_val, title="Over Top Extreme", style=shape.arrowdown, color=over_ext_col, location=location.absolute, size=size.huge)
//plotshape(over_bot_val, title="Over Bottom Extreme", style=shape.arrowup, color=over_ext_col, location=location.absolute, size=size.huge)

//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=2, transp=40)
plot(0, title="Zero Line", color=cciTurbo>100?color.blue:cciTurbo<-100?color.red:color.navy, style=plot.style_line, linewidth=6, transp=20)
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[2]>linreg_cci14[3] and linreg_cci14[1]>linreg_cci14[2] and linreg_cci14[0]<linreg_cci14[1] and linreg_cci14[0]>0
bott_cci= linreg_cci14[2]<linreg_cci14[3] and linreg_cci14[1]<linreg_cci14[2] and linreg_cci14[0]>linreg_cci14[1] and linreg_cci14[0]<0

//Put signal
x1=
       peak_cci
       and cci14[1]>100
       and cci14[2]>100
       and cciTurbo[3]>100
       and not over_top_val[1]

//Call signal
y1=
       bott_cci
       and cci14[1]<-100
       and cci14[2]<-100
       and cciTurbo[3]<-100
       and not over_bot_val[1]

no_orders =
       not x1[1]
       and not x1[2]
       and not x1[3]
       and not x1[4]
       and not x1[5]
       and not y1[1]
       and not y1[2]
       and not y1[3]
       and not y1[4]
       and not y1[5]

//Function
xTech=
       x1 and no_orders
    

yTech=
       y1 and no_orders
    

//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,10):yTech?color.new(color.blue,10):color.new(color.navy,10)
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)
//plotchar(PutSignal, title='Put', char="◉", text="Put", location=location.absolute, color=color.red, textcolor=color.black, offset=1, transp=0, size=size.small)
//plotchar(CallSignal, title='Call', char="◉", text="Call", location=location.absolute, color=color.blue, textcolor=color.black, offset=1, transp=0, size=size.small)

//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
 
@vĩnh0902 @Trương Nhật hàng cho tuần mới
=== Ảnh hiệu suất ===
View attachment 135533 View attachment 135534

=== Code ===
Mã:
// BO - Woodies CCI with RSI Filter- 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 = 07, title = "From Hour", minval = 00, maxval = 23)
FromMinuteDvM = input(defval = 00, title = "From Minute", minval = 00, maxval = 59)
ToHourDvM   = input(defval = 19, title = "To Hour", minval = 00, maxval = 23)
ToMinuteDvM = input(defval = 00, 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)

//RSI value
rsitt=input(true,title="=== RSI Filter ===")
src = close, len = input(17, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

//RSI Extreme
top_ext=round(highest(rsi[1],len)/2)
bot_ext=-top_ext
ext_col=color.new(color.aqua,10)
//plot(top_ext, title="Top Extreme", linewidth=2, color=ext_col, style=plot.style_stepline)
//plot(bot_ext, title="Bottom Extreme", linewidth=2, color=ext_col, style=plot.style_stepline)

//RSI Bar
rsi_val =rsi-50
rsi_bar_up = rsi_val>0?rsi_val:na
rsi_bar_dn = rsi_val<0?rsi_val:na
bar_up_col=color.new(color.blue,50)
bar_dn_col=color.new(color.red,50)
//plot(rsi_bar_up, title="RSI Upward", style=plot.style_columns, color=bar_up_col)
//plot(rsi_bar_dn, title="RSI Downward", style=plot.style_columns, color=bar_dn_col)

//Over Extreme Arrow
over_arrow=input(true,title="Enable Over Extreme Arrow")
over_ext_col=color.new(color.navy,10)
over_top_val= rsi_val>top_ext
over_bot_val= rsi_val<bot_ext
//plotshape(over_top_val, title="Over Top Extreme", style=shape.arrowdown, color=over_ext_col, location=location.absolute, size=size.huge)
//plotshape(over_bot_val, title="Over Bottom Extreme", style=shape.arrowup, color=over_ext_col, location=location.absolute, size=size.huge)

//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=2, transp=40)
plot(0, title="Zero Line", color=cciTurbo>100?color.blue:cciTurbo<-100?color.red:color.navy, style=plot.style_line, linewidth=6, transp=20)
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[2]>linreg_cci14[3] and linreg_cci14[1]>linreg_cci14[2] and linreg_cci14[0]<linreg_cci14[1] and linreg_cci14[0]>0
bott_cci= linreg_cci14[2]<linreg_cci14[3] and linreg_cci14[1]<linreg_cci14[2] and linreg_cci14[0]>linreg_cci14[1] and linreg_cci14[0]<0

//Put signal
x1=
       peak_cci
       and cci14[1]>100
       and cci14[2]>100
       and cciTurbo[3]>100
       and not over_top_val[1]

//Call signal
y1=
       bott_cci
       and cci14[1]<-100
       and cci14[2]<-100
       and cciTurbo[3]<-100
       and not over_bot_val[1]

no_orders =
       not x1[1]
       and not x1[2]
       and not x1[3]
       and not x1[4]
       and not x1[5]
       and not y1[1]
       and not y1[2]
       and not y1[3]
       and not y1[4]
       and not y1[5]

//Function
xTech=
       x1 and no_orders
  

yTech=
       y1 and no_orders
  

//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,10):yTech?color.new(color.blue,10):color.new(color.navy,10)
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)
//plotchar(PutSignal, title='Put', char="◉", text="Put", location=location.absolute, color=color.red, textcolor=color.black, offset=1, transp=0, size=size.small)
//plotchar(CallSignal, title='Call', char="◉", text="Call", location=location.absolute, color=color.blue, textcolor=color.black, offset=1, transp=0, size=size.small)

//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
huhu iq k có lệnh 30p hic tiếc thiệt . k biêt thằng olymtrade hay binary.com có uy tín k nhi cac bac để e nạp zô xin ít cafe
 
Chỉnh sửa lần cuối:
huhu iq k có lệnh 30p hic tiếc thiệt . k biêt thằng olymtrade hay binary.com có uy tín k nhi cac bac để e nạp zô xin ít cafe
Cái vụ sàn là mình bó tay, sàn chỉ là công cụ để mình chạy code thui chứ còn vụ uy tín thì mình chịu :D
Hic, đang chạy 1 lệnh kìa, đáo hạn 1 nến là có xèng nãy giờ rùi á :D
 

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

  • DuongHuy trong Hệ thống giao dịch - Trading system 37,498 Xem / 18 Trả lời
  • Mạc An trong Phân tích Forex - Vàng - Hàng hóa 1,574 Xem / 94 Trả lời
  • DuongHuy trong Phân tích Forex - Vàng - Hàng hóa 368 Xem / 29 Trả lời
  • Quíc Óp trong Phân tích Forex - Vàng - Hàng hóa 357 Xem / 18 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