| Overall Statistics |
|
Total Orders 2 Average Win 0% Average Loss 0% Compounding Annual Return 1.110% Drawdown 2.100% Expectancy 0 Start Equity 100000 End Equity 105228.79 Net Profit 5.229% Sharpe Ratio -2.377 Sortino Ratio -2.652 Probabilistic Sharpe Ratio 19.467% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.033 Beta 0.078 Annual Standard Deviation 0.012 Annual Variance 0 Information Ratio -0.736 Tracking Error 0.134 Treynor Ratio -0.35 Total Fees $0.00 Estimated Strategy Capacity $35000000.00 Lowest Capacity Asset SPY R735QTJ8XC9X Portfolio Turnover 0.00% Drawdown Recovery 708 |
#region imports
using System;
using QuantConnect.Brokerages;
using QuantConnect.Data;
using QuantConnect.Orders;
#endregion
namespace QuantConnect.Algorithm.CSharp
{
public class EzeBrokerageExampleAlgorithm : QCAlgorithm
{
private Symbol _symbol;
public override void Initialize()
{
SetStartDate(2021, 1, 1);
SetCash(100000);
SetBrokerageModel(BrokerageName.Eze, AccountType.Margin);
_symbol = AddEquity("SPY", Resolution.Minute).Symbol;
// Set default order properties
DefaultOrderProperties.TimeInForce = TimeInForce.GoodTilCanceled;
}
public override void OnData(Slice data)
{
if (Portfolio.Invested)
{
return;
}
// Place an order with the default order properties
LimitOrder(_symbol, 10, data[_symbol].Price + 10);
// Place an order and with new order properties
var orderProperties = new EzeOrderProperties
{
TimeInForce = TimeInForce.Day,
Notes = "QuantConnect Order",
};
var ticket = LimitOrder(_symbol, 10, Math.Round(data[_symbol].Price * 0.9m, 2), orderProperties: orderProperties);
// Update the order
var updateFields = new UpdateOrderFields {
Quantity = 8,
LimitPrice = Math.Round(data[_symbol].Price + 10, 2),
Tag = "Informative order tag"
};
var response = ticket.Update(updateFields);
if (!LiveMode && response.IsSuccess)
{
Debug("Order updated successfully");
}
}
}
}