|
|
@ -214,10 +214,10 @@ void LP_autopriceset(void *ctx,int32_t dir,struct LP_priceinfo *relpp,struct LP_ |
|
|
|
double margin,minprice; int32_t changed; |
|
|
|
if ( (margin= basepp->margins[relpp->ind]) != 0. ) |
|
|
|
{ |
|
|
|
printf("%s/%s %.8f dir.%d margin %.8f (%.8f %.8f)\n",relpp->symbol,basepp->symbol,price,dir,margin,1. / (price * (1. - margin)),(price * (1. + margin))); |
|
|
|
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);
|
|
|
|
if ( (minprice= basepp->minprices[relpp->ind]) == 0. || price >= minprice ) |
|
|
|
{ |
|
|
|
LP_mypriceset(&changed,relpp->symbol,basepp->symbol,price); |
|
|
@ -416,7 +416,7 @@ void prices_loop(void *ignore) |
|
|
|
{ |
|
|
|
if ( (buycoin= jstr(retjson,"buycoin")) != 0 && (buy= LP_coinfind(buycoin)) != 0 && (sellcoin= jstr(retjson,"sellcoin")) != 0 && (sell= LP_coinfind(sellcoin)) != 0 ) |
|
|
|
{ |
|
|
|
maxprice = 1.02 * LP_myprice(&bid,&ask,buycoin,sellcoin); |
|
|
|
maxprice = LP_myprice(&bid,&ask,buycoin,sellcoin); |
|
|
|
printf("base buy.%s force %f, rel sell.%s force %f relvolume %f maxprice %.8f (%.8f %.8f)\n",buycoin,jdouble(retjson,"buyforce"),sellcoin,jdouble(retjson,"sellforce"),sell->relvolume,maxprice,bid,ask); |
|
|
|
if ( maxprice > SMALLVAL ) |
|
|
|
{ |
|
|
|