Overall Statistics |
Total Trades 27 Average Win 0.33% Average Loss -0.45% Compounding Annual Return 15.284% Drawdown 1.300% Expectancy 0.205 Net Profit 1.178% Sharpe Ratio 2.377 Probabilistic Sharpe Ratio 64.444% Loss Rate 31% Win Rate 69% Profit-Loss Ratio 0.74 Alpha 0.111 Beta 0.096 Annual Standard Deviation 0.052 Annual Variance 0.003 Information Ratio -0.004 Tracking Error 0.082 Treynor Ratio 1.284 Total Fees $0.00 Estimated Strategy Capacity $250000.00 |
class BootCampTask(QCAlgorithm): def Initialize(self): self.SetCash(1000) self.SetStartDate(2017, 5, 1) self.SetEndDate(2017, 5, 30) self.flag = True #1. Request the forex data self.symbol = self.AddForex("AUDUSD", Resolution.Daily, Market.FXCM).Symbol #2. Set the brokerage model print(type(self.Portfolio.CashBook)) def OnData(self, data): self.Debug(f"Total Cash Before = \n{self.Portfolio.CashBook}") #3. Using "Portfolio.Invested" submit 1 order for 2000 AUDUSD: if self.flag: self.MarketOrder(self.symbol, 1000) elif not self.flag: self.MarketOrder(self.symbol, -1000) self.flag = not self.flag self.Debug(f"Total Cash After = \n{self.Portfolio.CashBook}")