jl777 7 years ago
parent
commit
4f5b224abb
  1. 6
      iguana/exchanges/LP_portfolio.c

6
iguana/exchanges/LP_portfolio.c

@ -537,6 +537,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
{
if ( LP_autorefs[i].fundbid[0] != 0 && (price= jdouble(fundjson,LP_autorefs[i].fundbid)) > SMALLVAL )
{
printf("%s %.8f -> ",LP_autorefs[i].fundbid,price);
if ( tickerjson != 0 && LP_autorefs[i].count == 0 )
price = LP_tickered_price(0,base,rel,price,tickerjson);
newprice = (1. / price) * (1. + buymargin);
@ -546,10 +547,11 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
newprice = LP_autorefs[i].lastbid;
LP_mypriceset(&changed,rel,base,newprice);
LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,rel,base,newprice);
//printf("fundbid %.8f margin %.8f newprice %.8f\n",price,margin,newprice);
printf("fundbid %.8f margin %.8f newprice %.8f\n",price,buymargin,newprice);
}
if ( LP_autorefs[i].fundask[0] != 0 && (price= jdouble(fundjson,LP_autorefs[i].fundask)) > SMALLVAL )
{
printf("%s %.8f -> ",LP_autorefs[i].fundask,price);
if ( tickerjson != 0 && LP_autorefs[i].count == 0 )
price = LP_tickered_price(1,base,rel,price,tickerjson);
newprice = (price * (1. + sellmargin));
@ -559,7 +561,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
newprice = LP_autorefs[i].lastask;
LP_mypriceset(&changed,base,rel,newprice);
LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,base,rel,newprice);
//printf("fundask %.8f margin %.8f newprice %.8f\n",price,margin,newprice);
printf("fundask %.8f margin %.8f newprice %.8f\n",price,sellmargin,newprice);
}
LP_autorefs[i].count++;
}

Loading…
Cancel
Save