Overall Statistics |
Total Trades 67 Average Win 1.23% Average Loss -1.20% Compounding Annual Return -3.260% Drawdown 19.000% Expectancy -0.156 Net Profit -12.424% Sharpe Ratio -0.29 Loss Rate 58% Win Rate 42% Profit-Loss Ratio 1.02 Alpha -0.093 Beta 4.25 Annual Standard Deviation 0.082 Annual Variance 0.007 Information Ratio -0.49 Tracking Error 0.082 Treynor Ratio -0.006 Total Fees $0.00 |
using QuantConnect.Indicators.CandlestickPatterns; namespace QuantConnect { /// <summary> /// Basic template algorithm simply initializes the date range and cash /// </summary> public class TestCandlestickAlgorithm : QCAlgorithm { private string _symbol = "EURUSD"; private Harami _pattern = new Harami(); /// <summary> /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized. /// </summary> public override void Initialize() { SetStartDate(2015, 1, 1); //Set Start Date SetEndDate(2018, 12, 31); //Set End Date SetCash(100000); //Set Strategy Cash // Find more symbols here: http://quantconnect.com/data AddForex(_symbol, Resolution.Daily); _pattern = CandlestickPatterns.Harami(_symbol); } /// <summary> /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. /// </summary> /// <param name="data">Slice object keyed by symbol containing the stock data</param> public override void OnData(Slice data) { if (_pattern == 1) { // Bullish Harami, go long SetHoldings(_symbol, 1); } else if (_pattern == -1) { // Bearish Harami, go short SetHoldings(_symbol, -1); } } } }