Overall Statistics |
Total Trades 2 Average Win 0% Average Loss 0.00% Compounding Annual Return -0.071% Drawdown 0.000% Expectancy -1 Net Profit -0.004% Sharpe Ratio -3.742 Loss Rate 100% Win Rate 0% Profit-Loss Ratio 0 Alpha -0.001 Beta 0.001 Annual Standard Deviation 0 Annual Variance 0 Information Ratio -4.816 Tracking Error 0.042 Treynor Ratio -0.331 Total Fees $4.00 |
namespace QuantConnect { public class BasicTemplateAlgorithm : QCAlgorithm { private int pipTarget = 5; private decimal pipProfit; private bool canTrade = true; public override void Initialize() { SetStartDate(2017, 1, 1); AddSecurity(SecurityType.Forex, "EURUSD", Resolution.Minute); canTrade = true; var minPriceVariation = Securities["EURUSD"].SymbolProperties.MinimumPriceVariation * 10; pipProfit = pipTarget * minPriceVariation; } public void OnData(TradeBars data) { if (canTrade) { MarketOrder("EURUSD", 1000); LimitOrder("EURUSD", -1000, data["EURUSD"].Value + pipProfit); canTrade = false; Debug("Purchased EURUSD on " + Time.ToShortDateString()); Debug("Limit price: " + data["EURUSD"].Value + pipProfit); } } } }