title: Why am I getting this error? (QuantConnect Algorithm)
body: <p>I'm just getting started with QuantConnect, but I understand Python fairly well, or so I thought. This is the important part of my code:</p>
  
  <pre><code>def Initialize(self):
      # Set the cash we'd like to use for our backtest
      # This is ignored in live trading 
      self.SetCash(5000)
  
      # Start and end dates for the backtest.
      # These are ignored in live trading.
      self.SetStartDate(2015,1,1)
      self.SetEndDate(2018,1,1)
  
      # Set Brokerage model to load OANDA fee structure.
      self.SetBrokerageModel(BrokerageName.OandaBrokerage)
  
      # Add assets you'd like to see
      # self.eurusd = self.AddForex("EURUSD", Resolution.Minute).Symbol
      self.usdjpy = self.AddForex("USDJPY", Resolution.Minute).Symbol
      # self.eurjpy = self.AddForex("EURJPY", Resolution.Minute).Symbol
  
  
  
  def OnData(self, slice):
  
      rsi = self.RSI("USDJPY", 14, MovingAverageType.Simple)
  
      if rsi &gt; 72:
          self.SetHoldings("USDJPY", 1)
  
      if rsi &lt; 28:
          self.SetHoldings("USDJPY", 1)
  </code></pre>
  
  <p>This is the error I'm getting:</p>
  
  <pre><code>Runtime Error: TypeError : Cannot get managed object
    at OnData in main.py:line 36
   TypeError : Cannot get managed object
  </code></pre>
  
  <p>Stacktrace:</p>
  
  <pre><code>    System.Exception: TypeError : Cannot get managed object
       at OnData in main.py:line 73
       ---&gt; Python.Runtime.PythonException: TypeError : Cannot get managed object
       at Python.Runtime.PyObject.Invoke (Python.Runtime.PyTuple args, 
       Python.Runtime.PyDict kw) [0x00033] in &lt;0f995c28c5b446ad8835419f76b319a3&gt;:0 
       at Python.Runtime.PyObject.InvokeMethod (System.String name, 
       Python.Runtime.PyTuple args, Python.Runtime.PyDict kw) [0x00007] in 
       &lt;0f995c28c5b446ad8835419f76b319a3&gt;:0 
        at Python.Runtime.PyObject.TryInvokeMember 
         (System.Dynamic.InvokeMemberBinder binder, System.Object[] args, 
        System.Object&amp; result) [0x0003e] in &lt;0f995c28c5b446ad8835419f76b319a3&gt;:0 
        at (wrapper dynamic-method) 
   System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,QuantConnect.Data.Slice)
  </code></pre>
  
  <p>I have tried to edit the way I create the variable 'rsi' but nothing seems to work. Can someone tell me what I'm doing wrong?</p>