class_docstr: Singleton class wrapping to control the connections to Oanda.
  
  Params:
  
    - ``token`` (default:``None``): API access token
  
    - ``account`` (default: ``None``): account id
  
    - ``practice`` (default: ``False``): use the test environment
  
    - ``account_tmout`` (default: ``10.0``): refresh period for account
      value/cash refresh
class_docstr_tok: ["Singleton","class","wrapping","to","control","the","connections","to","Oanda",".","Params",":","-","``","token","``","(","default",":","``","None","``",")",":","API","access","token","-","``","account","``","(","default",":","``","None","``",")",":","account","id","-","``","practice","``","(","default",":","``","False","``",")",":","use","the","test","environment","-","``","account_tmout","``","(","default",":","``","10.0","``",")",":","refresh","period","for","account","value\/cash","refresh"]
code: def _transaction(self, trans):
      # Invoked from Streaming Events. May actually receive an event for an
      # oid which has not yet been returned after creating an order. Hence
      # store if not yet seen, else forward to processer
      ttype = trans["type"]
      if ttype == "MARKET_ORDER_CREATE":
          try:
              oid = trans["tradeReduced"]["id"]
          except KeyError:
              try:
                  oid = trans["tradeOpened"]["id"]
              except KeyError:
                  return  # cannot do anything else
  
      elif ttype in self._X_ORDER_CREATE:
          oid = trans["id"]
      elif ttype == "ORDER_FILLED":
          oid = trans["orderId"]
  
      elif ttype == "ORDER_CANCEL":
          oid = trans["orderId"]
  
      elif ttype == "TRADE_CLOSE":
          oid = trans["id"]
          pid = trans["tradeId"]
          if pid in self._orders and False:  # Know nothing about trade
              return  # can do nothing
  
          # Skip above - at the moment do nothing
          # Received directly from an event in the WebGUI for example which
          # closes an existing position related to order with id -> pid
          # COULD BE DONE: Generate a fake counter order to gracefully
          # close the existing position
          msg = (
              "Received TRADE_CLOSE for unknown order, possibly generated"
              " over a different client or GUI"
          )
          self.put_notification(msg, trans)
          return
  
      else:  # Go aways gracefully
          try:
              oid = trans["id"]
          except KeyError:
              oid = "None"
  
          msg = "Received {} with oid {}. Unknown situation"
          msg = msg.format(ttype, oid)
          self.put_notification(msg, trans)
          return
  
      try:
          oref = self._ordersrev[oid]
          self._process_transaction(oid, trans)
      except KeyError:  # not yet seen, keep as pending
          self._transpend[oid].append(trans)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import collections
  from datetime import datetime, timedelta
  import time
  import json
  import threading
  import oandapy
  import requests
  import backtrader
  from backtrader.metabase import MetaParams
  from backtrader.utils.py3 import queue, with_metaclass
  from backtrader.utils import AutoDict
label_desc: Use image node_id 26 for calling the OandaStore obj's underlying member method code with example usage: obj._transaction(trans) without return types