class_docstr: Broker implementation for Oanda.
  
  This class maps the orders/positions from Oanda to the
  internal API of ``backtrader``.
  
  Params:
  
    - ``use_positions`` (default:``True``): When connecting to the broker
      provider use the existing positions to kickstart the broker.
  
      Set to ``False`` during instantiation to disregard any existing
      position
class_docstr_tok: ["Broker","implementation","for","Oanda",".","This","class","maps","the","orders\/positions","from","Oanda","to","the","internal","API","of","``","backtrader","``",".","Params",":","-","``","use_positions","``","(","default",":","``","True","``",")",":","When","connecting","to","the","broker","provider","use","the","existing","positions","to","kickstart","the","broker",".","Set","to","``","False","``","during","instantiation","to","disregard","any","existing","position"]
code: def data_started(self, data):
      pos = self.getposition(data)
  
      if pos.size < 0:
          order = SellOrder(
              data=data,
              size=pos.size,
              price=pos.price,
              exectype=Order.Market,
              simulated=True,
          )
  
          order.addcomminfo(self.getcommissioninfo(data))
          order.execute(
              0,
              pos.size,
              pos.price,
              0,
              0.0,
              0.0,
              pos.size,
              0.0,
              0.0,
              0.0,
              0.0,
              pos.size,
              pos.price,
          )
  
          order.completed()
          self.notify(order)
  
      elif pos.size > 0:
          order = BuyOrder(
              data=data,
              size=pos.size,
              price=pos.price,
              exectype=Order.Market,
              simulated=True,
          )
  
          order.addcomminfo(self.getcommissioninfo(data))
          order.execute(
              0,
              pos.size,
              pos.price,
              0,
              0.0,
              0.0,
              pos.size,
              0.0,
              0.0,
              0.0,
              0.0,
              pos.size,
              pos.price,
          )
  
          order.completed()
          self.notify(order)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import collections
  from copy import copy
  from datetime import date, datetime, timedelta
  import threading
  from backtrader.feed import DataBase
  from backtrader import TimeFrame, num2date, date2num, BrokerBase, Order, BuyOrder, SellOrder, OrderBase, OrderData
  from backtrader.utils.py3 import bytes, with_metaclass, MAXFLOAT
  from backtrader.metabase import MetaParams
  from backtrader.comminfo import CommInfoBase
  from backtrader.position import Position
  from backtrader.stores import oandastore
  from backtrader.utils import AutoDict, AutoOrderedDict
  from backtrader.comminfo import CommInfoBase
label_desc: Use image node_id 3 for calling the OandaBroker obj's underlying member method code with example usage: obj.data_started(data) without return types