Exemple #1
0
 public function setUp()
 {
     parent::setUp();
     $apiKey = $this->settings['oanda']['apiKey'];
     $accountId = $this->settings['oanda']['accountId'];
     $type = $this->settings['oanda']['serverType'];
     $pairs = $this->settings['oanda']['pairs'];
     $this->oandaInfo = new Broker_Oanda($type, $apiKey, $accountId, $pairs);
 }
Exemple #2
0
 /**
      * require Args array
     $args = array(
     'time' => time(),
     'userid' => '',
     'oanda' => array(
     'accountId' => '',
     ),
     );
 */
 public function setUp()
 {
     parent::setUp();
     $accountId = $this->args['oanda']['accountId'];
     $account = R::findOne('accounts', ' accountid = ?', [$accountId]);
     if (!empty($account)) {
         $apiKey = $account['apikey'];
         $type = $account['servertype'];
         $this->oandaInfo = new Broker_Oanda($type, $apiKey, $accountId);
     } else {
         throw new \Exception('Oanda AccountId not found');
     }
 }