jl777 8 years ago
parent
commit
08465d2f0b
  1. 9
      basilisk/basilisk_tradebot.c

9
basilisk/basilisk_tradebot.c

@ -47,15 +47,24 @@ void basilisk_swap_balancingtrade(struct supernet_info *myinfo,struct basilisk_s
return; return;
} }
if ( iambob != 0 ) if ( iambob != 0 )
{
if ( myinfo->IAMLP != 0 )
{ {
printf("BOB: price %f * vol %f -> %s newprice %f margin %.2f%%\n",price,volume,dir < 0. ? "buy" : "sell",price + dir * price * profitmargin,100*profitmargin); printf("BOB: price %f * vol %f -> %s newprice %f margin %.2f%%\n",price,volume,dir < 0. ? "buy" : "sell",price + dir * price * profitmargin,100*profitmargin);
if ( dir < 0. ) if ( dir < 0. )
InstantDEX_buy(myinfo,0,0,0,"poloniex",base,rel,price,volume,dotrade); InstantDEX_buy(myinfo,0,0,0,"poloniex",base,rel,price,volume,dotrade);
else InstantDEX_sell(myinfo,0,0,0,"poloniex",base,rel,price,volume,dotrade); else InstantDEX_sell(myinfo,0,0,0,"poloniex",base,rel,price,volume,dotrade);
} }
}
else else
{
if ( myinfo->IAMLP != 0 )
{ {
printf("ALICE: price %f * vol %f -> %s newprice %f margin %.2f%%\n",price,volume,dir > 0. ? "buy" : "sell",price - dir * price * profitmargin,100*profitmargin); printf("ALICE: price %f * vol %f -> %s newprice %f margin %.2f%%\n",price,volume,dir > 0. ? "buy" : "sell",price - dir * price * profitmargin,100*profitmargin);
if ( dir > 0. )
InstantDEX_buy(myinfo,0,0,0,"poloniex",base,rel,price,volume,dotrade);
else InstantDEX_sell(myinfo,0,0,0,"poloniex",base,rel,price,volume,dotrade);
}
} }
} }

Loading…
Cancel
Save