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

10
iguana/exchanges/LP_portfolio.c

@ -542,9 +542,9 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
if ( tickerjson != 0 && LP_autorefs[i].count == 0 )
price = LP_tickered_price(0,base,rel,price,tickerjson);
newprice = (1. / (price * (1. + buymargin)));
if ( LP_autorefs[i].lastbid < SMALLVAL )
//if ( LP_autorefs[i].lastbid < SMALLVAL )
LP_autorefs[i].lastbid = newprice;
else LP_autorefs[i].lastbid = (LP_autorefs[i].lastbid * 0.9) + (0.1 *newprice);
//else LP_autorefs[i].lastbid = (LP_autorefs[i].lastbid * 0.9) + (0.1 *newprice);
newprice = LP_autorefs[i].lastbid;
LP_mypriceset(&changed,rel,base,newprice);
LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,rel,base,newprice);
@ -556,10 +556,10 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
if ( tickerjson != 0 && LP_autorefs[i].count == 0 )
price = LP_tickered_price(1,base,rel,price,tickerjson);
newprice = (price * (1. + sellmargin));
if ( LP_autorefs[i].lastask < SMALLVAL )
//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);
if ( LP_autorefs[i].lastbid < SMALLVAL || LP_autorefs[i].lastask > LP_autorefs[i].lastbid )
//else LP_autorefs[i].lastask = (LP_autorefs[i].lastask * 0.9) + (0.1 *newprice);
if ( LP_autorefs[i].lastbid < SMALLVAL || LP_autorefs[i].lastask >= LP_autorefs[i].lastbid/(1. + sellmargin) )
newprice = LP_autorefs[i].lastask;
else newprice = LP_autorefs[i].lastbid * (1. + sellmargin);
LP_mypriceset(&changed,base,rel,newprice);

Loading…
Cancel
Save