Browse Source

Test

etomic
jl777 8 years ago
parent
commit
70d2b9d49f
  1. 8
      iguana/exchanges/LP_ordermatch.c

8
iguana/exchanges/LP_ordermatch.c

@ -585,6 +585,8 @@ char *LP_autotrade(char *myipaddr,int32_t mypubsock,double profitmargin,char *ba
return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); return(clonestr("{\"error\":\"cant set ordermatch quote info\"}"));
price = LP_query(myipaddr,mypubsock,profitmargin,"request",&Q); price = LP_query(myipaddr,mypubsock,profitmargin,"request",&Q);
bestitem = LP_quotejson(&Q); bestitem = LP_quotejson(&Q);
if ( price > SMALLVAL )
{
if ( price <= maxprice ) if ( price <= maxprice )
{ {
price = LP_query(myipaddr,mypubsock,profitmargin,"connect",&Q); price = LP_query(myipaddr,mypubsock,profitmargin,"connect",&Q);
@ -614,6 +616,12 @@ char *LP_autotrade(char *myipaddr,int32_t mypubsock,double profitmargin,char *ba
jaddnum(bestitem,"maxprice",maxprice); jaddnum(bestitem,"maxprice",maxprice);
jaddstr(bestitem,"status","too expensive"); jaddstr(bestitem,"status","too expensive");
} }
}
else
{
jaddnum(bestitem,"maxprice",maxprice);
jaddstr(bestitem,"status","no response to request");
}
return(jprint(bestitem,0)); return(jprint(bestitem,0));
} }

Loading…
Cancel
Save