Binary Options Strategy Template

With the hype around Binary Options trading (more like gambling instead of trading) it is good to be able to backtest a strategy before using it in the live markets.
In a Binary Options trade the trade get's closed after a specific amount of time and the only thing that matters is if the market has increased in price or decreased after that amount of time.

Because of this a strategy backtest should close all positions after a specific amount of time. In this super small script the number of bars since the trade was opened is used as a way to close the position. So for example if you use this strategy on the 1 minute charts with number of bars set to 5 it will close the position 5 minutes after opening it. Purpose of this script is using it as a strategy on already existing scripts to check viability for options trading.

With the limited pine knowledge that I have I do not know if it is possible to create a more realistic binary options strategy which also calculated the profit. If someone knows a more advanced version of this please let me know.
오픈 소스 스크립트

진정한 TradingView의 정신에 따라, 이 스크립트의 작성자는 스크립트를 오픈소스로 게시했기에 거래자들이 이해하고 확인할 수 있습니다. 작가님께 건배! 스크립트를 무료로 사용할 수 있지만, 게시물에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 당신은 스크립트를 차트에 사용하기 위해 그것을 즐겨찾기 할 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?