|
@ -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)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|