| Overall Statistics |
|
Total Trades 59 Average Win 0% Average Loss 0% Compounding Annual Return 1.614% Drawdown 10.400% Expectancy 0 Net Profit 0% Sharpe Ratio 0.321 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.014 Beta 0.004 Annual Standard Deviation 0.044 Annual Variance 0.002 Information Ratio -0.592 Tracking Error 0.124 Treynor Ratio 3.385 Total Fees $59.00 |
using QuantConnect.Orders.Slippage;
namespace QuantConnect
{
public class CustomSlippageModelAlgorithm : QCAlgorithm
{
string _symbol = "IBM";
bool _boughtToday = false;
public override void Initialize()
{
SetStartDate(2013, 06, 01);
AddSecurity(SecurityType.Equity, _symbol, Resolution.Minute);
//Set your own slippage model: Securities is the collection of company objects
Securities[_symbol].SlippageModel = new CustomSlippageModel();
}
/// <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;
}
}
}
// Custom slippage implementation
public class CustomSlippageModel : ISlippageModel {
public decimal GetSlippageApproximation(Security asset, Order order) {
return 0.2m;
}
}
}