Browse Source

Test

etomic
jl777 8 years ago
parent
commit
78f8b30557
  1. 14
      iguana/exchanges/LP_prices.c

14
iguana/exchanges/LP_prices.c

@ -738,15 +738,10 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo
coinpp->bid[trexflag] = jdouble(item,trexflag != 0 ? "Bid" : "BidPrice"); coinpp->bid[trexflag] = jdouble(item,trexflag != 0 ? "Bid" : "BidPrice");
coinpp->ask[trexflag] = jdouble(item,trexflag != 0 ? "Ask" : "AskPrice"); coinpp->ask[trexflag] = jdouble(item,trexflag != 0 ? "Ask" : "AskPrice");
//coinpp->prevday = jdouble(item,"PrevDay"); //coinpp->prevday = jdouble(item,"PrevDay");
printf("iter.%d trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",iter,trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]); //printf("iter.%d trexflag.%d %s high %.8f, low %.8f, last %.8f hbla.(%.8f %.8f)\n",iter,trexflag,symbol,coinpp->high[trexflag],coinpp->low[trexflag],coinpp->last[trexflag],coinpp->bid[trexflag],coinpp->ask[trexflag]);
if ( coinpp->bid[trexflag] > SMALLVAL && coinpp->ask[trexflag] > SMALLVAL ) if ( coinpp->bid[trexflag] > SMALLVAL && coinpp->ask[trexflag] > SMALLVAL )
{ {
if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL ) price = 0.5 * (coinpp->bid[trexflag] + coinpp->ask[trexflag]);
{
printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]);
continue;
}
else price = 0.5 * (coinpp->bid[trexflag] + coinpp->ask[trexflag]);
if ( iter == 0 ) if ( iter == 0 )
{ {
if ( strcmp(symbol,"KMD") == 0 ) if ( strcmp(symbol,"KMD") == 0 )
@ -759,6 +754,11 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo
printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc); printf("(%s/%s) iter.%d trexflag.%d %s %.8f %.8f\n",refpp->symbol,coinpp->symbol,iter,trexflag,symbol,price,price/kmdbtc);
price /= kmdbtc; price /= kmdbtc;
} }
if ( trexflag == 0 && coinpp->bid[1] > SMALLVAL && coinpp->ask[1] > SMALLVAL )
{
//printf("have trex: iter.%d trexflag.%d %s %.8f %.8f\n",iter,trexflag,symbol,coinpp->bid[1],coinpp->ask[1]);
continue;
}
LP_autopriceset(ctx,1,refpp,coinpp,price); LP_autopriceset(ctx,1,refpp,coinpp,price);
LP_autopriceset(ctx,-1,coinpp,refpp,price); LP_autopriceset(ctx,-1,coinpp,refpp,price);
} }

Loading…
Cancel
Save