|
@ -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 ) |
|
|
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 ) |
|
|
if ( tickerjson != 0 && LP_autorefs[i].count == 0 ) |
|
|
price = LP_tickered_price(0,base,rel,price,tickerjson); |
|
|
price = LP_tickered_price(0,base,rel,price,tickerjson); |
|
|
newprice = (1. / price) * (1. + buymargin); |
|
|
newprice = (1. / price) * (1. + buymargin); |
|
@ -546,10 +547,11 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) |
|
|
newprice = LP_autorefs[i].lastbid; |
|
|
newprice = LP_autorefs[i].lastbid; |
|
|
LP_mypriceset(&changed,rel,base,newprice); |
|
|
LP_mypriceset(&changed,rel,base,newprice); |
|
|
LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,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 ) |
|
|
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 ) |
|
|
if ( tickerjson != 0 && LP_autorefs[i].count == 0 ) |
|
|
price = LP_tickered_price(1,base,rel,price,tickerjson); |
|
|
price = LP_tickered_price(1,base,rel,price,tickerjson); |
|
|
newprice = (price * (1. + sellmargin)); |
|
|
newprice = (price * (1. + sellmargin)); |
|
@ -559,7 +561,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) |
|
|
newprice = LP_autorefs[i].lastask; |
|
|
newprice = LP_autorefs[i].lastask; |
|
|
LP_mypriceset(&changed,base,rel,newprice); |
|
|
LP_mypriceset(&changed,base,rel,newprice); |
|
|
LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,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++; |
|
|
LP_autorefs[i].count++; |
|
|
} |
|
|
} |
|
|