From 6077c784112a8ca5c21d807d4b452a2f08a4b028 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Apr 2017 14:26:34 +0300 Subject: [PATCH] Test --- iguana/exchanges/mm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 9990f0331..3ab5e98e0 100644 --- a/iguana/exchanges/mm.c +++ b/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); else bid = avebid - profitmargin*aveprice, ask = avebid + profitmargin*aveprice; 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))); 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. ) 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)); if ( askincr < 0.1*incr )