Post
Topic
Board Project Development
Re: Qt Bitcoin Trader [Open Source secure trading client for Mac/Windows/Linux]
by
mojBitcoin.si
on 05/09/2014, 10:36:25 UTC
some thoughts, nice to have:
- trader.get("10MinBuyDivSell") changed to trader.get("BuyToSell", minutes) so we can define timeframe we are interested in. Same for 10MinVolume.
- trader.get("NoOfTrades", minutes) - number of transactions in last x minutes.
- a way to access LastTrades: trader.get("LastTrades", minutes) - to retrieve all trades in last X minutes.
- a way to access orderbook: trader.get("Orderbook", fromPrice, toPrice) - to retrieve all orders from orderbook between specified price range.
- buy and sell commands should return ID, so we can later check / cancel specific order

Currently there is limitation to 10 minutes and later I'll add intervals.
Give me examples how you want to use retrieved orders using JavaScript.

>buy and sell commands should return ID
I planned to make virtual IDs, so it will be returned instantly.

With new build on mac, AsksVolume and AsksPrice still return 0

Something like that:
Code:
var spikeOrder;
var lastPrice = trader.get("LastPrice");
var asksPrice = trader.get("AsksPrice",100); // get the price 100 coins away


if (asksPrice - lastPrice > 10) { // if price diff is worth a trade
  var orders = trader.get("Orderbook", asksPrice-1, asksPrice+1); // get the orders around target price
  for (i = 0; i < orders.length; i++) {
    if (orders[i].volume > 10) { // check for big orders
      asksPrice = orders[i].price - 0.01; // set target price in front of big order
      break;
    }
  }
  if (spikeOrder) { // remove previous order
    trader.cancelOrder(spikeOrder);
  }
  spikeOrder = trader.sell(1, asksPrice); // place order
 
}

or

Code:
   var orders = trader.get("Orderbook", lastPrice, lastPrice+30); // get ask orders
   for (i = 0; i < orders.length; i++) {
     if (orders[i].volume > 50) { // check for walls
      trader.say("Ask wall " + orders[i].volume + " at " + orders[i].price);
     }
  }