Binance API anwenden

Traderlino

Neues Mitglied
Hallo, ich weiss nicht mehr weiter und brauche kurz eure Hilfe.

Wenn diesen code ausführe:
Code:
if (BuyOrderGesetzt == false) {
        binance.orderStatus(Waehrung, 4866946, function (error, OrderStatusStream) {
      process.stdout.write('\n');
      console.log("orderStatus(): ", OrderStatusStream);
      for (var j = 0; j < OrderStatusStream.length; j++) {
         orderStatus2 = OrderStatusStream[j].status;
      }
      console.log("orderStatus2: ", orderStatus2);
        });
   BuyOrderGesetzt = true;
}

der erste console.log() gibt das hier aus, soweit so gut:

orderStatus(): { symbol: 'PPTETH',
orderId: 4866946,
clientOrderId: 'jzHOET9WMd1Ghxi3eCK,
price: '0.03139000',
origQty: '1.01000000',
executedQty: '0.00000000',
status: 'CANCELED',
timeInForce: 'GTC',
type: 'LIMIT',
side: 'BUY',
stopPrice: '0.00000000',
icebergQty: '0.00000000',
time: 1518439213614,
isWorking: true }


aber bei der zweiten console.log() wird das hier ausgegeben, sollte aber CANCELED ausgegeben werden. orderStatus2 ist eine globale variable var orderStatus2;
Ich möchte einfach dass in der variable orderStatus2 der Status (hier CANCELED) steht.
orderStatus2: undefined
Was mache ich falsch ?
Bitte um Hilfe.
 

Neue Themen


Oben