jl777 7 years ago
parent
commit
5e7d26c979
  1. 10
      iguana/exchanges/LP_portfolio.c

10
iguana/exchanges/LP_portfolio.c

@ -533,12 +533,12 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
{
if ( (fundjson= LP_fundvalue(argjson)) != 0 )
{
//printf("%s\n",jprint(fundjson,0));
printf("%s\n",jprint(fundjson,0));
if ( jint(fundjson,"missing") == 0 )
{
if ( LP_autorefs[i].fundbid[0] != 0 && (price= jdouble(fundjson,LP_autorefs[i].fundbid)) > SMALLVAL )
{
//printf("%s/%s %s %.8f -> %.8f or %.8f",base,rel,LP_autorefs[i].fundbid,price,(1. / (price * (1. + buymargin))),(1. / (price * (1. - buymargin))));
printf("%s/%s %s %.8f -> %.8f or %.8f",base,rel,LP_autorefs[i].fundbid,price,(1. / (price * (1. + buymargin))),(1. / (price * (1. - buymargin))));
if ( tickerjson != 0 && LP_autorefs[i].count == 0 )
price = LP_tickered_price(0,base,rel,price,tickerjson);
newprice = (1. / (price * (1. + buymargin)));
@ -548,11 +548,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,buymargin,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/%s %s %.8f -> ",base,rel,LP_autorefs[i].fundask,price);
printf("%s/%s %s %.8f -> ",base,rel,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));
@ -564,7 +564,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
else newprice = LP_autorefs[i].lastbid * (1. + sellmargin);
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,sellmargin,newprice);
printf("fundask %.8f margin %.8f newprice %.8f\n",price,sellmargin,newprice);
}
LP_autorefs[i].count++;
}

Loading…
Cancel
Save