Browse Source

Test

etomic
jl777 8 years ago
parent
commit
82c10671f9
  1. 4
      iguana/exchanges/LP_portfolio.c
  2. 3
      iguana/exchanges/goal

4
iguana/exchanges/LP_portfolio.c

@ -31,9 +31,11 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin)
jaddnum(item,"force",coin->force);
jaddnum(item,"balanceA",dstr(coin->balanceA));
jaddnum(item,"valuesumA",dstr(coin->valuesumA));
if ( coin->valuesumA != 0 )
jaddnum(item,"aliceutil",100. * (double)coin->balanceA/coin->valuesumA);
jaddnum(item,"balanceB",dstr(coin->balanceB));
jaddnum(item,"valuesumB",dstr(coin->valuesumB));
if ( coin->valuesumB != 0 )
jaddnum(item,"bobutil",100. * (double)coin->balanceB/coin->valuesumB);
return(item);
}
@ -91,7 +93,7 @@ char *LP_portfolio()
if ( goalsum > SMALLVAL && coin->goal > SMALLVAL )
{
coin->goalperc = 100. * coin->goal / goalsum;
if ( (coin->force= (coin->perc - coin->goalperc)) < 0. )
if ( (coin->force= (coin->goalperc - coin->perc)) < 0. )
coin->force *= -coin->force;
else coin->force *= coin->force;
} else coin->perc = coin->force = 0.;

3
iguana/exchanges/goal

@ -1,3 +1,4 @@
source userpass
curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"KMD\",\"goal\":99}"
curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"goal\":1}"
curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"BTC\",\"goal\":10}"
curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"goal\",\"coin\":\"REVS\",\"goal\":1}"

Loading…
Cancel
Save