Overall Statistics
Total Trades
153
Average Win
0.57%
Average Loss
0%
Compounding Annual Return
76.013%
Drawdown
7.400%
Expectancy
0
Net Profit
47.055%
Sharpe Ratio
2.126
Loss Rate
0%
Win Rate
100%
Profit-Loss Ratio
0
Alpha
0.42
Beta
-0.057
Annual Standard Deviation
0.192
Annual Variance
0.037
Information Ratio
0.951
Tracking Error
0.228
Treynor Ratio
-7.162
Total Fees
$0.00
import numpy as np

class TachyonMultidimensionalThrustAssembly(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019, 1, 1)
        self.SetCash(200)
        self.AddForex("EURUSD", Resolution.Minute, Market.Oanda)
        self.SetBrokerageModel(BrokerageName.OandaBrokerage)
        self.rsi = self.RSI("EURUSD", 14)

    def OnData(self, data):

        if not self.rsi.IsReady: 
            return
        
        if self.rsi.Current.Value < 20 and self.Portfolio["EURUSD"].Invested <= 0:
            self.MarketOrder("EURUSD", 1000)
            self.LimitOrder("EURUSD", -1000, data["EURUSD"].Ask.Close + 0.0015)

        if self.rsi.Current.Value > 80 and self.Portfolio["EURUSD"].Invested <= 0:
            self.MarketOrder("EURUSD", -1000)
            self.LimitOrder("EURUSD", 1000, data["EURUSD"].Ask.Close - 0.0015)
    
    def OnEndOfDay(self):
        self.Plot("Indicators","RSI", self.rsi.Current.Value)