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 order_create(self, order, stopside=None, takeside=None, **kwargs):
      okwargs = dict()
      okwargs["instrument"] = order.data._dataname
      okwargs["units"] = abs(order.created.size)
      okwargs["side"] = "buy" if order.isbuy() else "sell"
      okwargs["type"] = self._ORDEREXECS[order.exectype]
      if order.exectype != bt.Order.Market:
          okwargs["price"] = order.created.price
          if order.valid is None:
              # 1 year and datetime.max fail ... 1 month works
              valid = datetime.utcnow() + timedelta(days=30)
          else:
              valid = order.data.num2date(order.valid)
              # To timestamp with seconds precision
          okwargs["expiry"] = int(
              (valid - self._DTEPOCH).total_seconds()
          )
  
      if order.exectype == bt.Order.StopLimit:
          okwargs["lowerBound"] = order.created.pricelimit
          okwargs["upperBound"] = order.created.pricelimit
  
      if order.exectype == bt.Order.StopTrail:
          okwargs["trailingStop"] = order.trailamount
  
      if stopside is not None:
          okwargs["stopLoss"] = stopside.price
  
      if takeside is not None:
          okwargs["takeProfit"] = takeside.price
  
      okwargs.update(**kwargs)  # anything from the user
  
      self.q_ordercreate.put(
          (
              order.ref,
              okwargs,
          )
      )
      return order
  
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 22 for calling the OandaStore obj's underlying member method code with example usage: obj.order_create(order, stopside, takeside) and returns: order