Overall Statistics |
Total Trades 67 Average Win 0% Average Loss 0% Compounding Annual Return -0.400% Drawdown 5.900% Expectancy 0 Net Profit 0% Sharpe Ratio -0.136 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.003 Beta 0.003 Annual Standard Deviation 0.022 Annual Variance 0 Information Ratio -0.783 Tracking Error 0.114 Treynor Ratio -0.983 Total Fees $67.00 |
using QuantConnect.Orders.Fees; namespace QuantConnect { /* * QuantConnect University: Zero Fee Transaction Model * * Transaction model with zero fees. */ public class OverrideTransactionModelsAlgorithm : QCAlgorithm { string _symbol = "IBM"; bool _boughtToday = false; /// <summary> /// Initialize your algorithm configuration (cash, dates, securities) /// </summary> public override void Initialize() { //Set the start and end dates for backtest: SetStartDate(2013, 06, 01); SetEndDate(DateTime.Now.Date.AddDays(-1)); //Set algorithm cash: SetCash(200000); //Add all the securities you'd like: AddSecurity(SecurityType.Equity, _symbol, Resolution.Minute); //Set your own fee model: Securities is the collection of company objects //Securities[_symbol].FeeModel = new ConstantFeeModel(0); SetBrokerageModel(new InteractiveBrokersBrokerageModel()); } /// <summary> /// TradeBars Data Event Handler - all IBM data passed into the data object: data["IBM"].Close /// </summary> public void OnData(TradeBars data) { //Meaningless algorithm which buys on the 15th day of the month: // Using this we can test our $5,000 order fee :) if (Time.Day % 15 == 0 && _boughtToday == false) { Order(_symbol, 5); Debug("Sent order for " + _symbol + " on " + Time.ToShortDateString()); _boughtToday = true; } else if (Time.Day % 15 != 0) { _boughtToday = false; } } } }