Overall Statistics
Total Trades
341
Average Win
0.02%
Average Loss
-0.03%
Compounding Annual Return
-1.021%
Drawdown
0.600%
Expectancy
-0.016
Net Profit
-0.089%
Sharpe Ratio
-0.454
Loss Rate
38%
Win Rate
62%
Profit-Loss Ratio
0.58
Alpha
-0.111
Beta
6.763
Annual Standard Deviation
0.017
Annual Variance
0
Information Ratio
-1.338
Tracking Error
0.017
Treynor Ratio
-0.001
Total Fees
$0.00
class FirstOandaAlgorithm(QCAlgorithm):

    def Initialize(self):
    
        self.SetStartDate(2013,10, 1)  
        self.SetEndDate(2013,11,1)   
        self.SetCash(100000)           
        self.AddForex("EURUSD", Resolution.Minute)
        self.rsi = self.RSI("EURUSD", 14,  MovingAverageType.Simple, Resolution.Minute)
        self.SetWarmup(10)


    def OnData(self, data):
        
        if not self.Portfolio.Invested:
            if self.rsi.Current.Value < 10:
                self.SetHoldings("EURUSD", 0.95)
            elif self.rsi.Current.Value > 90:
                self.SetHoldings("EURUSD", -0.95)
        else:
            if self.rsi.Current.Value > 40 and self.rsi.Current.Value < 60:
                self.SetHoldings("EURUSD", 0)