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

6
iguana/exchanges/LP_portfolio.c

@ -548,7 +548,7 @@ 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 )
{
@ -590,8 +590,8 @@ 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("%s/%s price %.8f margin %.8f/%.8f newprice %.8f %.8f\n",base,rel,price,buymargin,sellmargin,newprice,(1. / price) * (1. + sellmargin));
newprice = (1. / price) * (1. + sellmargin);
printf("%s/%s price %.8f margin %.8f/%.8f newprice %.8f %.8f\n",base,rel,price,buymargin,sellmargin,newprice,(1. / newprice) * (1. + sellmargin));
newprice = (1. / newprice) * (1. + sellmargin);
if ( LP_autorefs[i].lastask < SMALLVAL )
LP_autorefs[i].lastask = newprice;
else LP_autorefs[i].lastask = (LP_autorefs[i].lastask * 0.9) + (0.1 *newprice);

Loading…
Cancel
Save