jl777 7 years ago
parent
commit
6e71bf2b47
  1. 7
      iguana/exchanges/LP_portfolio.c
  2. 2
      iguana/exchanges/LP_prices.c

7
iguana/exchanges/LP_portfolio.c

@ -571,7 +571,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
}
else if ( strcmp(LP_autorefs[i].refrel,"coinmarketcap") == 0 )
{
printf("%s/%s for %s/%s margin %.8f/%.8f\n",base,rel,LP_autorefs[i].refbase,LP_autorefs[i].refrel,buymargin,sellmargin);
//printf("%s/%s for %s/%s margin %.8f/%.8f\n",base,rel,LP_autorefs[i].refbase,LP_autorefs[i].refrel,buymargin,sellmargin);
if ( (price_btc= LP_CMCbtcprice(&price_usd,LP_autorefs[i].refbase)) > SMALLVAL )
{
if ( LP_autorefs[i].usdpeg != 0 )
@ -871,14 +871,15 @@ void prices_loop(void *ctx)
char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp;
strcpy(prices_loop_stats.name,"prices_loop");
prices_loop_stats.threshold = 600000.;
printf("start prices_loop\n");
while ( LP_STOP_RECEIVED == 0 )
{
printf("G.initializing.%d prices loop autoprices.%d autorefs.%d\n",G.initializing,LP_autoprices,num_LP_autorefs);
if ( G.initializing != 0 )
{
sleep(1);
sleep(30);
continue;
}
//printf("prices loop autoprices.%d autorefs.%d\n",LP_autoprices,num_LP_autorefs);
LP_millistats_update(&prices_loop_stats);
LP_tradebots_timeslice(ctx);
if ( (btcpp= LP_priceinfofind("BTC")) == 0 )

2
iguana/exchanges/LP_prices.c

@ -1230,7 +1230,7 @@ double LP_CMCbtcprice(double *price_usdp,char *symbol)
item = jitem(ticker,0);
price_btc = jdouble(item,"price_btc");
*price_usdp = jdouble(item,"price_usd");
printf("%.8f item.(%s)\n",price_btc,jprint(item,0));
//printf("%.8f item.(%s)\n",price_btc,jprint(item,0));
free_json(ticker);
}
free(retstr);

Loading…
Cancel
Save