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
Joseph Jones
Jamie Waters
Jamie Waters
Michael Schoenfield
Jamie Waters
Michael Schoenfield
Tadas Talaikis
Michael Schoenfield
Tadas Talaikis
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; } } } }
Michael Schoenfield
Michael Schoenfield
Tadas Talaikis
Jared Broad
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.
Jamie Waters
Jared Broad
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.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.
Jared Broad
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.
Michael Schoenfield
Tadas Talaikis
Michael Schoenfield
Tadas Talaikis
Jamie Waters
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!