aquajets1

Binary Options Tester w/ Vdubus money management

Added implementation of vdubus's money management strategy to binary options tester. As before, the entry/exit strategy is just there for an example, modify go_down and go_up for your strategy as the short and long entry points. Also as before, do not use present variables (i.e. close, close, ema_6_min in the example) in go_up and go_down, as this is akin to having future information. Calling past forms of compound present variables (ema(close,6)) is fine.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//@version=2
study("Binary Options Tester w/ Vdubus money management", overlay=false)

ema_6_min = ema(close,6)
ema_14_min = ema(close,14)

go_down = crossunder(ema_6_min[1],ema_14_min[1])
go_up = crossover(ema_6_min[1],ema_14_min[1])

//win/lose testing. leave these lines for tester
val_win = go_down ? ((open[0] > close[0]) ? (val_win[1] + 1) : (val_win[1])) : (go_up ? ((open[0] < close[0]) ? (val_win[1] + 1) : (val_win[1])) : (nz(val_win[1]) + 0))
val_lose = go_down ? ((open[0] < close[0]) ? (val_lose[1] + 1) : (val_lose[1])) : (go_up ? ((open[0] > close[0]) ? (val_lose[1] + 1) : (val_lose[1])) : (nz(val_lose[1]) + 0))
//

fraction_return = input(.75, title='fraction_return')

return = (val_win * fraction_return)  - val_lose

//plot(return)
//plot(val_win,color=green)
//plot(val_lose,color=red)
//plot(sma_12_min, color=blue)
//plot(sma_60_min, color=orange)
//plot(val_win/(val_win + val_lose))

//Section for testing vdbus money management strat.
did_win = val_win[0] > val_win[1]
did_lose = val_lose[0] > val_lose[1]

top_out = input(3)

factor = did_win ? ((nz(factor[1]) + 1) % top_out) : (did_lose ? 0 : nz(factor[1]))

bet_factor = nz(factor[1])

bet = pow((1 + fraction_return),bet_factor)

winnings_on_bet = bet * (fraction_return)

strat_return = did_win ? (nz(strat_return[1]) + winnings_on_bet) : (did_lose ? (nz(strat_return[1]) - bet) : nz(strat_return[1]))

plot(strat_return)