|
|
@ -302,7 +302,7 @@ void LP_autopriceset(int32_t ind,void *ctx,int32_t dir,struct LP_priceinfo *base |
|
|
|
LP_autorefs[ind].lastask = newprice; |
|
|
|
else LP_autorefs[ind].lastask = (LP_autorefs[ind].lastask * 0.9) + (0.1 *newprice); |
|
|
|
newprice = LP_autorefs[ind].lastask; |
|
|
|
printf("autopriceset %s/%s <- %.8f %.8f (%.8f %.8f)\n",basepp->symbol,relpp->symbol,price,newprice,LP_autorefs[ind].lastbid,LP_autorefs[ind].lastask); |
|
|
|
//printf("autopriceset %s/%s <- %.8f %.8f (%.8f %.8f)\n",basepp->symbol,relpp->symbol,price,newprice,LP_autorefs[ind].lastbid,LP_autorefs[ind].lastask);
|
|
|
|
} |
|
|
|
LP_mypriceset(&changed,relpp->symbol,basepp->symbol,newprice); |
|
|
|
if ( changed != 0 || time(NULL) > lasttime+LP_ORDERBOOK_DURATION*.777) |
|
|
@ -602,7 +602,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) |
|
|
|
relpp = LP_priceinfofind(rel); |
|
|
|
if ( basepp != 0 && relpp != 0 ) |
|
|
|
{ |
|
|
|
printf("check ref-autoprice %s/%s %f %f (%.8f %.8f)\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel,relpp->fixedprices[basepp->ind],basepp->fixedprices[relpp->ind],LP_autorefs[i].lastbid,LP_autorefs[i].lastask); |
|
|
|
//printf("check ref-autoprice %s/%s %f %f (%.8f %.8f)\n",LP_autorefs[i].refbase,LP_autorefs[i].refrel,relpp->fixedprices[basepp->ind],basepp->fixedprices[relpp->ind],LP_autorefs[i].lastbid,LP_autorefs[i].lastask);
|
|
|
|
LP_autopriceset(i,ctx,1,basepp,relpp,0.,LP_autorefs[i].refbase,LP_autorefs[i].refrel); |
|
|
|
} |
|
|
|
} |
|
|
@ -624,8 +624,7 @@ void LP_autoprices_update(char *method,char *base,double basevol,char *rel,doubl |
|
|
|
{ |
|
|
|
printf("%s: autoprice ask update %s/%s %.8f vs myprice %.8f/%.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastbid,LP_autorefs[i].lastask,newprice); |
|
|
|
LP_autorefs[i].lastask = newprice; |
|
|
|
} |
|
|
|
else printf("%s: autoprice ask skip update %s/%s %.8f vs myprice %.8f/%.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastbid,LP_autorefs[i].lastask,newprice); |
|
|
|
} // else printf("%s: autoprice ask skip update %s/%s %.8f vs myprice %.8f/%.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastbid,LP_autorefs[i].lastask,newprice);
|
|
|
|
} |
|
|
|
else if ( strcmp(LP_autorefs[i].rel,base) == 0 && strcmp(rel,LP_autorefs[i].base) == 0 ) |
|
|
|
{ |
|
|
@ -634,8 +633,7 @@ void LP_autoprices_update(char *method,char *base,double basevol,char *rel,doubl |
|
|
|
{ |
|
|
|
printf("%s: autoprice bid update %s/%s %.8f vs myprice %.8f/%.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastbid,LP_autorefs[i].lastask,newprice); |
|
|
|
LP_autorefs[i].lastbid = newprice; |
|
|
|
} |
|
|
|
else printf("%s: autoprice bid skip update %s/%s %.8f vs myprice %.8f/%.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastbid,LP_autorefs[i].lastask,newprice); |
|
|
|
} // else printf("%s: autoprice bid skip update %s/%s %.8f vs myprice %.8f/%.8f -> %.8f\n",method,base,rel,price,LP_autorefs[i].lastbid,LP_autorefs[i].lastask,newprice);
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|