Here is F# port of RenkoConsolidator.
This sample shows:
1) Event handling in f-sharp
2) basic structure of QCAlgorithm implementation
3) how to use QuantConnect.Data.Consolidators in f-sharp
4) Magic sprintf function
Here is F# port of RenkoConsolidator.
This sample shows:
1) Event handling in f-sharp
2) basic structure of QCAlgorithm implementation
3) how to use QuantConnect.Data.Consolidators in f-sharp
4) Magic sprintf function
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.
Good stuff! I don't have a ton of familiarity with fsharp but its good to see a little variety. Thank you for sharing Casper.
But the web-platform seems not work with multiple f# source code; and .fs needs to be compiled in specific order.
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.
no problem ;)
type BasicTemplateAlgorithm() =
inherit QCAlgorithm()
let pdt() = new PatternDayTradingMarginModel
//Implement core methods:
override this.Initialize() =
this.SetCash(100000)
this.SetStartDate(2013, 10, 7)
this.SetEndDate(2013, 10, 11)
this.AddEquity("SPY", Resolution.Second) |> ignore
this.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash);
//ERROR: This value is not a function and cannot be applied
this.Securities["SPY"].MarginModel <- pdt()
//TradeBars Data Event
member this.OnData(bar:TradeBars) =
if not this.Portfolio.Invested then
this.SetHoldings(this.Symbol("SPY"), 1)
else
()
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.
this.Securities.Item("SPY").MarginModel <- new PatternDayTradingMarginModel()
this.Securities.["SPY"].MarginModel <- new PatternDayTradingMarginModel()
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.
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!