Back

Binary Strategies?

Hi Folks.. well this is my first post here and my head has been blown!

Fairly new to binary trading and I've recently been given a very simple 60 second strategy (just using BB indicator) that seems to hold up on the visual back testing I've done.

Quick question - am I able to use QC for this.... and where would I start?

Perhaps my lack of experience in the industry is quite telling - thanks for your time!

Jamie
Update Backtest








Hi Jamie, I am new to all this too. Got started 2 weeks ago, didn't know any C# and barely knew what a BB was. 2 weeks later and I am doing all kinds of cool backtests to prove/disprove theories in professionally written investor textbooks!

QC is great and you can totally use QC to try out your strategy. I recommend you go to University then clone the Indicators - ATR, BB, MACD etc. strategy. Run a backtest and verify it works. Next, find the area of the code if (!Portfolio.HoldStock) and modify it to buy and sell according to the value of _bb. An example of logic like this is in "QCU EMA + SMA Indicators". Take 10 minutes to study all the university examples and then you can put together mental building blocks of things you can try out together.
0

Thanks Joseph, I did get a software engineering degree and in the 10 years since I left uni, I've not used it once... until now!

Will report back how I get on
0

For essence of speed, is there a developer channel that I could pay someone to create one for me?
0

I'm no expert either, but I have fun trying new things if you wanted I'd like to give it a shot, no payment necessary.
0

That would be ace, thanks!

It's quite simple - Binary Options, Bollinger Bands set to 20 2.6. If a bar closes above or below the band, take the opposite direction trade for 60 seconds.

Getting about a 71% success rate, so would love to automate it.

Good luck!

PS - Feel free to add me on Facebook if that's easier - http://fb.com/watersj
0

Any thoughts on where Binary Option data might be supplied from?

-Michael
0

Hey guys, I think you should use regular FX data as binaries data don't differ from underlyings. Backtests will not show real results unless you make custom equity chart/statistics, you will need to take win_percentage*payout_aproximation-losss_percentage*amount_per_trade.
2

@Tadas Yah that's what I thought we would have to do, I don't quite know how that would work though. Do you have any suggestions on where to start (like function calls or classes?) to look for that kind of functionality? I know custom charting is doable, I'm just concerned about how to keep the equity calculated throughout, would I do a manual update of my equity amount (based on the payout approximation) with each trade?

Also are you suggesting just run a full simulation and at the end get the win% and loss%, and apply an approximation formula, that way we can see how it did overall in a backtesting situation?

-Michael

PS. Is there a timer function that keeps a position open for a set amount of time then closes it, or would one start the trade then wait for 60 ticks of OnData (at a second time frame) and then close the trade?

PSS. Sorry I'm not better at this, but practice makes better, right?
0

Yes, I think the simplest way to know if binary strategy can be successful is to use %wins/losses and approximate result. Equity curve may be plotted as line, but maybe someone from QC will comment on this.

Regarding close after some time, here's how to do it:


namespace QuantConnect
{

public class Sample : QCAlgorithm
{
DateTime lastTradeTime;

//Initialize the data and resolution you require for your strategy:
public override void Initialize()
{
...
}

//Data Event Handler: New data arrives here. "TradeBars" type is a dictionary of strings so you can access it by symbol.
public void OnData(TradeBars data)
{

//close after 60 seconds
if(Portfolio.HoldStock && (data[symbol].Time - lastTradeTime).TotalSeconds > 60)
{
Liquidate(symbol);
}

if (!Portfolio.HoldStock)
{
Buy(symbol, 1);
lastTradeTime = data[symbol].Time;
}

}

}
}
1

@Tadas Talaikis I hate to keep asking you questions, but I couldn't find a clear answer when scouring the code. I am calculating win's by if the trade was profitable (this could easily be changed to be based on price with a few more if statements) but I was wondering if you know a quick way to turn off fee's when doing SetHoldings and Liquidate.

-Michael
0

Also thanks for all your help!!!!

Michael
0

Fees? default transaction fees are 0.
1

Default fees are Interactive Broker's rates - but you can setup no fee model very easily, please see brand new QC University algorithm :) "Zero Transaction Fee Model"

@JamieWaters - can you give more information about binary options in general? How is the payout calculated? This will help @Michael make the strategy. As much information as possible will help :)
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hey @Jared Broad, thanks for stopping buy.

Me and Michel have taken it to PM to take things a bit further and we are getting there.

In answer to your question and to use a different analogy, Binary Options is similar to betting - You place a bet that the value of a currency pair (eg EUR/USD) is going to UP or DOWN over the next x amount of time.

If you 'bet' correctly you return your stake plus a % (average is 70% but we trade 60 seconds so it is at least 80%). If you lose, you lose your stake.

If a strategy is about 60% successful, it means you are generally in profit.

So for example, a $200 position will return you $160 profit on a 60 second position.

Hope that helps
1

Thanks for the explanation :) You guys seem to have it sorted so I left you to it. I know nothing about this so its interesting to see if we can do it. Given the description above perhaps it could be modeled easiest by not using QC's portfolio system since its not really designed for that:


public class BinaryAlgorithm : QCAlgorithm
{
private decimal _cash = 1000;
private decimal _entryPrice = 0;
private decimal _stake = 200;

public override void Initialize()
{
SetCash(_cash);
}

public void OnData(TradeBars data)
{
EnterTrade(data);

if (Holding and Time Passed) {
if (_entryPrice > data[IBM].price) {
_cash += _stake * 0.8;
} else {
_cash -= _stake ;
}
Portfolio.SetCash(_cash);
}
}

public void EnterTrade(TradeBars data) {
//Rules for entry.
_entryPrice = Securities["IBM"].Price;
}
}


This way you get the backtest + chart.
2

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I've just created a framework for doing this and put it into the QC University. Hopefully that should jump start your strategy design and allow others to backtest binary options as well.

Its listed in the university under "Binary Options Framework". It will allow placing long and short bets, and manages the cash and charting.
2

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hey everybody,

So I wanted to check in and ask some questions, I haven't yet made a full attempt to convert to Jared's framework. This is what I put together after his first suggestion, issues I'm having are how to handle multiple symbols, while keeping track of everything such as wins and indicators, etc..... Also for some reason no matter what I do I can't seem to get this algorithm to run for more than one day. I was hoping others might have opinions and contributions they would be willing to offer up about, this algorithm and handling multiple symbols!

If that's too vague, feel free to probe further!

-Michael
2


Good start into vanilla/exotic options :) Thought it's harder to do equity chart/basic stats.

@Michael Schoenfield, code has division by zero.
0

Hi Community,

Wanted to send in an update.

I think the attached version is an attempt at our algorithm (but I switched it to be more like based off of Jared's Binary Options Framework.
It still has the issue of only doing one day at a time essentially, and I cannot for the life of me figure out why that is. For example it says the algorithm completes, yet it only has had one day of operation. If anyone has any idea's about why this might be, I get pretty good single day results, but I'd love to be able to see multiple days to know if that's a fluke O.o

Sincerely,
Michael Schoenfield
0


I've replicated such issue from basic template also trying to find what's wrong. So, hold on :)
1

Replicated the error -- it seems like something new with indicators + FX triggering this condition: (https://github.com/QuantConnect/Lean/blob/master/Indicators/IndicatorBase.cs#L87). I'm working on it now :) Hang tight
1

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I saw "this is forward only" before, should have reported it earlier :)
0

Fixed, sorry about that. It was an edge case glitch in the fill-forward when we reached the end of a FX trading day on Friday. We now accurately model the FX closing time for Friday & open time Sunday so the fill-forward works nicely.
1

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi All,

I am wondering if there is a platform like "iq option" with

(1) Binary options

(2) Five second line chart

(3) Trade remains open for one whole minute. After 1 minute you automatically get your profit or Loss.

(4) The platform allows algorithmic trading for backtesting and real money trading with strategies. (Allows algorithmic trading or robots or Expert Advisors).

Does Quantconnect facilitates all this? Is their any other platform that provides all this for Algo-trading?

Thanking you in advance

Tauqeer

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed