Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 0.000% Drawdown 0.000% Expectancy 0 Net Profit 0.000% Sharpe Ratio -1.282 Probabilistic Sharpe Ratio 0.377% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha -0 Beta 0 Annual Standard Deviation 0 Annual Variance 0 Information Ratio 1.196 Tracking Error 0.047 Treynor Ratio -0.06 Total Fees $0.00 Estimated Strategy Capacity $520000000000.00 Lowest Capacity Asset EURUSD 8G |
class OandaBrokerageExampleAlgorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2021, 1, 1) self.SetCash(100000) self.SetBrokerageModel(BrokerageName.OandaBrokerage, AccountType.Margin) self.symbol = self.AddForex("EURUSD", Resolution.Minute).Symbol def OnData(self, data): if self.Portfolio.Invested: return # Place an order with the default order properties ticket = self.LimitOrder(self.symbol, 1, round(data[self.symbol].Price * .9, 5)) # Update the order order_fields = UpdateOrderFields() order_fields.Quantity = 2 order_fields.LimitPrice = round(data[self.symbol].Price * 1.1, 5) order_fields.Tag = "Informative order tag" response = ticket.Update(order_fields) if not self.LiveMode and response.IsSuccess: self.Debug('Order updated successfully')