tanayroy

Why and how to use Binary Option Strategy Tester?

FX:EURUSD   Euro / U.S. Dollar
I want to start with a disclaimer that binary option trading is banned in India and I don’t trade binary options on any platform.
I learned about this particular derivative product class from my friend, who insists that I trade binary with martingale (no loss options!). He showed me some strategies and trades on a demo account and profited every time applying martingale. I felt curious to know more about this product, where I just have to predict the next candle.
A small note on Martingale, if you don’t know:
This is a way to increase the size of the bet after a losing bet, so that you can recoup your losses if you eventually win. For example, If the payout is 70% (If you bet $1 and you win, you will get $0.7) and you bet $1 and lose, your next bet would be $2. This way you can recover your early loss and make some profit.


To extend further, I started to gather all available strategies and found lots of lucrative claims. Due to its different nature, the general backtester is not compatible with binary options. I love to see stats behind any claim, but am not able to test any strategy due to absence of any formal strategy tester for binary options.
I started to code to test those strategies and build the strategy tester with Martingale. Soon, I realized that all the quick gain claims are not true. I am not saying that binary options are not profitable, there are some smart traders who are making good profit. But you need to test the claim before putting your money.
Let me elaborate this with a strategy.
I found the following strategy somewhere on the web, but I don't have the link to give credentials to them.
Strategy:-
Interval: 2 minutes
Indicator: Bollinger Band with 7 SMA and 3 STDV
Entry Rules:
  1. Wait for the price to cross the Bollinger band middle point.
  2. If price crosses the Bollinger band middle point (cross up or down does not matter), wait for a candle that does not touch upper or lower band and middle band.
  3. If we able to find the candle, we will enter our trade as per the candle color
  4. If the color of the candle is green we’ll take Higher or Buy or Call. If color of candle is red we’ll take a Lower or sale or Put
  5. We have to take the trade within last 2 seconds of present candle for next two minutes duration
  6. If we lose we’ll go to level II martingale and follow the losing candle color
  7. To minimize the number of trade, we’ll restrict ourselves to one trade per cross.
Following chart elaborates the strategy in detail.
Let's code the strategy:
length = input.int(7, minval=1)
src = input(close, title="Source")
mult = input.float(3.0, minval=0.001, maxval=50, title="StdDev")
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev

fab_candle_upcross=(high< upper and low>basis) 

fab_candle_downcross= (high< basis and low>lower)

up_cross=ta.barssince(ta.crossover(close,basis))
down_cross=ta.barssince(ta.crossunder(close,basis))
is_first_up=false
is_first_down=false
if fab_candle_upcross
    for a=1 to up_cross 
        if fab_candle_upcross[a]
            is_first_up:=false
            break
        else
            is_first_up:=true

if fab_candle_downcross
    for a=1 to down_cross 
        if fab_candle_downcross[a]
            is_first_down:=false
            break
        else
            is_first_down:=true

        

//strategy for buying call
is_call=(is_first_up or is_first_down ) and close>open

//strategy for selling call
is_put=(is_first_up or is_first_down ) and close<open
Put this line of code in strategy tester and get all historical trades.
The default setup result:
You can play with other available test options but the strategy is not able to produce any positive result in back test.
What can be done further to make the strategy tester better?
My Wishlist for advance development.
More Martingale: Present strategy tester can be improved by adding more martingale levels (Up to 15?).
Strategy Martingale: We are using the martingale per trade basis but can use strategy wise. Like if we make a loss in the first signal, instead of starting martingale immediately we may wait for the next signal to put the martingale amount.
Number of candles to hold: The present strategy holds one interval, but holding multiple candles can be a good option.
Select Period to test the strategy: The strategy should adopt specific period(within a date range) testing.
Martingale optimization: Given a strategy, can we optimize martingale level, i.e at what martingale level strategy may produces 100% profit. And what is the distribution of martingales?
Investment risk: Maximum investment amount reached historically applying martingale
Last trade stat: Getting recent trade stat is helpful to evaluate the strategy, Last 3,5,10,15,20 and 30 trade stats can add more analytical power.
Day wise stat: Profitability stat as per day (Mon, Tue etc.)
Month Wise stat: Performance per month (Performance in January, February etc.)
Buy Sell Flip: If we apply the buy rule for sale and sale rules for buy.
Trade Restriction: Quit trading after a certain number of consecutive losses or wins.

The above 10 points can improve the strategy tester significantly. If you have any idea that can improve the strategy tester please share with me.



Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.