From b9e5d7105218946efac48e6fcad29adb6778ecaf Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 7 Jan 2017 18:12:20 +0200 Subject: [PATCH] test --- basilisk/tradebots_liquidity.c | 45 +++++++++++++++++----------------- iguana/iguana777.c | 2 +- iguana/iguana_notary.c | 4 +-- iguana/main.c | 1 + iguana/tests/arbinit | 2 +- 5 files changed, 28 insertions(+), 26 deletions(-) diff --git a/basilisk/tradebots_liquidity.c b/basilisk/tradebots_liquidity.c index f2d8a1b5d..4ac7ffb06 100755 --- a/basilisk/tradebots_liquidity.c +++ b/basilisk/tradebots_liquidity.c @@ -501,7 +501,7 @@ float *get_features(int32_t numfeatures,int32_t refc,int32_t ind) return(svmf); } -double set_ocas_model(int refc,int answerind,double *W,double W0,int numfeatures,int firstweekind,int len,int bad,double dist,double predabs,int posA,int negA,double answerabs,double aveanswer) +/*double set_ocas_model(int refc,int answerind,double *W,double W0,int numfeatures,int firstweekind,int len,int bad,double dist,double predabs,int posA,int negA,double answerabs,double aveanswer) { int32_t i,nonz=0; for (i=0; i perc ) + int32_t _posA,_negA; double *tmpW,fileperc; + tmpW = calloc(numfeatures+2,sizeof(*tmpW)); + if ( (fileperc= load_model(&_posA,&_negA,tmpW,refc,answerind,numfeatures)) > perc ) { if ( (_posA+_negA) != 0 && _posA >= posA && _negA >= negA ) { memcpy(W,tmpW,sizeof(*W)*numfeatures); - printf("%s.A%02d numfeatures.%d posA.%d negA.%d saved model %f is better than %f +A%d -A%d\n",CONTRACTS[refc],answerind,numfeatures,_posA,_negA,fileperc,perc,posA,negA); + printf("%s/%s.A%02d numfeatures.%d posA.%d negA.%d saved model %f is better than %f +A%d -A%d\n",Arbpairs[refc].base,Arbpairs[refc].rel,answerind,numfeatures,_posA,_negA,fileperc,perc,posA,negA); + W0 = tmpW[numfeatures]; + free(tmpW); return(tmpW[numfeatures]); } } + free(tmpW); #endif save_model(refc,answerind,W,numfeatures,W0,perc,posA,negA); return(W0); -}*/ +} #ifndef _WIN #include "tradebots_SVM.h" diff --git a/iguana/iguana777.c b/iguana/iguana777.c index f8fc045ce..d992d87e7 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -841,7 +841,7 @@ void iguana_callcoinstart(struct supernet_info *myinfo,struct iguana_info *coin) { char NOTARYCHAINS[][16] = { "USD", "EUR", "JPY", "GBP", "AUD", "CAD", "CHF", "NZD", // major currencies "CNY", "RUB", "MXN", "BRL", "INR", "HKD", "TRY", "ZAR", "PLN", "NOK", "SEK", "DKK", "CZK", "HUF", "ILS", "KRW", "MYR", "PHP", "RON", "SGD", "THB", "BGN", "IDR", "HRK", - "KMD", "BTC", "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW" }; + "KMD", "BTC", "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW", "MVP" }; struct iguana_bundle *bp; struct iguana_peer *addr; int32_t i,bundlei; bits256 zero; char dirname[512],*symbol; iguana_rwiAddrind(coin,0,0,0); //for (i=0; ichain); i++) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 645321ae6..3735ec2eb 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -437,7 +437,7 @@ STRING_AND_INT(dpow,fundnotaries,symbol,numblocks) int32_t komodo_notaries(char *symbol,uint8_t pubkeys[64][33],int32_t height); char CURRENCIES[][16] = { "USD", "EUR", "JPY", "GBP", "AUD", "CAD", "CHF", "NZD", // major currencies "CNY", "RUB", "MXN", "BRL", "INR", "HKD", "TRY", "ZAR", "PLN", "NOK", "SEK", "DKK", "CZK", "HUF", "ILS", "KRW", "MYR", "PHP", "RON", "SGD", "THB", "BGN", "IDR", "HRK", - "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW" }; + "REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW", "MVP" }; uint8_t pubkeys[64][33]; cJSON *infojson; char coinaddr[64],cmd[1024]; uint64_t signedmask; int32_t i,j,sendflag=0,current=0,height; FILE *fp; double vals[64],sum,val = 0.01; int32_t n = komodo_notaries("KMD",pubkeys,114000); if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("KMD")) != 0 ) @@ -490,7 +490,7 @@ STRING_AND_INT(dpow,fundnotaries,symbol,numblocks) } else return(clonestr("{\"error\":\"cant find BTC\"}")); } - for (i=0; i