Browse Source

Test

etomic
jl777 8 years ago
parent
commit
6077c78411
  1. 4
      iguana/exchanges/mm.c

4
iguana/exchanges/mm.c

@ -666,7 +666,7 @@ void marketmaker(double minask,double maxbid,char *baseaddr,char *reladdr,double
bid = highbid * (1 - profitmargin), ask = lowask * (1 + profitmargin); bid = highbid * (1 - profitmargin), ask = lowask * (1 + profitmargin);
else bid = avebid - profitmargin*aveprice, ask = avebid + profitmargin*aveprice; else bid = avebid - profitmargin*aveprice, ask = avebid + profitmargin*aveprice;
marketmaker_spread("DEX",base,rel,bid,incr,ask,incr,profitmargin*aveprice*0.5); marketmaker_spread("DEX",base,rel,bid,incr,ask,incr,profitmargin*aveprice*0.5);
if ( (pendingbids + buyvol) > (pendingasks + sellvol) ) if ( (pendingbids + buyvol) > (pendingasks + sellvol) && (pendingbids + buyvol) > bidincr )
{ {
bidincr *= ((double)(pendingasks + sellvol) / ((pendingbids + buyvol) + (pendingasks + sellvol))); bidincr *= ((double)(pendingasks + sellvol) / ((pendingbids + buyvol) + (pendingasks + sellvol)));
printf("bidincr %f buy.(%f + %f) sell.(%f + %f)\n",bidincr,pendingbids,buyvol,pendingasks,sellvol); printf("bidincr %f buy.(%f + %f) sell.(%f + %f)\n",bidincr,pendingbids,buyvol,pendingasks,sellvol);
@ -675,7 +675,7 @@ void marketmaker(double minask,double maxbid,char *baseaddr,char *reladdr,double
if ( bidincr > 1. ) if ( bidincr > 1. )
bidincr = (int32_t)bidincr + 0.777; bidincr = (int32_t)bidincr + 0.777;
} }
if ( (pendingbids + buyvol) < (pendingasks + sellvol) ) if ( (pendingbids + buyvol) < (pendingasks + sellvol) && (pendingasks + sellvol) > askincr )
{ {
askincr *= (double)(pendingbids + buyvol) / ((pendingbids + buyvol) + (pendingasks + sellvol)); askincr *= (double)(pendingbids + buyvol) / ((pendingbids + buyvol) + (pendingasks + sellvol));
if ( askincr < 0.1*incr ) if ( askincr < 0.1*incr )

Loading…
Cancel
Save