From e915d3a5f88b8ecab3c21f3c6490a7d1c7a2b17e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Dec 2017 14:52:33 +0700 Subject: [PATCH] Test --- iguana/exchanges/LP_portfolio.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 46a5786b9..d3afc77ce 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -606,15 +606,21 @@ void LP_autoprices_update(char *method,char *base,double basevol,char *rel,doubl { newprice = (LP_autorefs[i].lastask * 0.99) + (0.01 * price); if ( LP_autorefs[i].lastask > 0 && price < LP_autorefs[i].lastask ) + { printf("%s: autoprice ask update %s/%s %.8f vs myprice %.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastask,newprice); - else printf("%s: autoprice ask update %s/%s %.8f vs myprice %.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastask,newprice); + LP_autorefs[i].lastask = newprice; + } + else printf("%s: autoprice ask skip update %s/%s %.8f vs myprice %.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastask,newprice); } else if ( strcmp(LP_autorefs[i].rel,base) == 0 && strcmp(rel,LP_autorefs[i].base) == 0 ) { newprice = (LP_autorefs[i].lastbid * 0.99) + (0.01 * price); if ( LP_autorefs[i].lastbid > 0 && price > LP_autorefs[i].lastbid ) + { printf("%s: autoprice bid update %s/%s %.8f vs myprice %.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastbid,newprice); - else printf("%s: autoprice bid update %s/%s %.8f vs myprice %.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastbid,newprice); + LP_autorefs[i].lastbid = newprice; + } + else printf("%s: autoprice bid skip update %s/%s %.8f vs myprice %.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastbid,newprice); } } }