|
|
@ -678,11 +678,11 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ |
|
|
|
if ( dir > 0 ) |
|
|
|
price = 1. / (price * (1. - margin)); |
|
|
|
else price = (price * (1. + margin)); |
|
|
|
printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin); |
|
|
|
//printf("%s/%s %.8f dir.%d margin %.8f\n",relpp->symbol,basepp->symbol,price,dir,margin);
|
|
|
|
if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) |
|
|
|
{ |
|
|
|
LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); |
|
|
|
printf("changed.%d\n",changed); |
|
|
|
//printf("changed.%d\n",changed);
|
|
|
|
if ( changed != 0 ) |
|
|
|
LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,relpp->symbol,basepp->symbol,price); |
|
|
|
} |
|
|
@ -817,7 +817,7 @@ void prices_loop(void *ignore) |
|
|
|
if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) |
|
|
|
{ |
|
|
|
printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); |
|
|
|
price = jdouble(retjson,"invprice"); |
|
|
|
price = jdouble(retjson,"price"); |
|
|
|
LP_autopriceset(ctx,1,kmdpp,fiatpp,price); |
|
|
|
LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); |
|
|
|
free_json(retjson); |
|
|
|