Skip to content

Commit

Permalink
Updated source without useless vars to resolve michaelgrosner#159.
Browse files Browse the repository at this point in the history
Free Software Free Society

To support commits by ctubio,
you can buy-me-a-drink with a small git tip at:
  1GitTipgxvKB3zjCLXRcSgDhC9pivkpc7u

I promise to drink chocolate milk in the development of the next commit.

To request new features or in case this commit breaks something for you,
please create a new github issue with all possible details,
but never share your API Keys!

Signed-off-by: Carles Tubio <[email protected]>
  • Loading branch information
ctubio committed Aug 23, 2017
1 parent 6ed3ca2 commit a9fa5ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Binary file modified dist/lib/K.linux.57.node
Binary file not shown.
13 changes: 7 additions & 6 deletions src/lib/mg.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ namespace K {
load();
thread([&]() {
if (uv_timer_init(uv_default_loop(), &mgStats_)) { cout << FN::uiT() << "Errrror: GW mgStats_ init timer failed." << endl; exit(1); }
mgStats_.data = gw;
mgStats_.data = NULL;
if (uv_timer_start(&mgStats_, [](uv_timer_t *handle) {
if (mgfairV) {
if (++mgT == 60) {
mgT = 0;
ewmaUp();
// updateEwmaValues();
ewmaPUp();
}
stdevUp();
stdevPUp();
} else cout << FN::uiT() << "Market Stats notice: missing fair value." << endl;
}, 0, 1000)) { cout << FN::uiT() << "Errrror: GW mgStats_ start timer failed." << endl; exit(1); }
}).detach();
Expand Down Expand Up @@ -103,7 +104,7 @@ namespace K {
calcStdev();
}
};
static void stdevUp() {
static void stdevPUp() {
if (!mgfairV or empty()) return;
mgStatFV.push_back(mgfairV);
mgStatBid.push_back(mGWmktFilter["/bids/0/price"_json_pointer].get<double>());
Expand Down Expand Up @@ -144,7 +145,7 @@ namespace K {
args.GetReturnValue().Set(Number::New(args.GetIsolate(), mgEwmaM));
};
static void _mgEwmaShort(const FunctionCallbackInfo<Value>& args) {
mgEwmaS = calcEwma(args[0]->NumberValue(), mgEwmaL, qpRepo["shortEwmaPeridos"].get<int>());
mgEwmaS = calcEwma(args[0]->NumberValue(), mgEwmaS, qpRepo["shortEwmaPeridos"].get<int>());
args.GetReturnValue().Set(Number::New(args.GetIsolate(), mgEwmaS));
};
static void _mgTBP(const FunctionCallbackInfo<Value>& args) {
Expand Down Expand Up @@ -201,7 +202,7 @@ namespace K {
};
return o;
};
static void ewmaUp() {
static void ewmaPUp() {
mgEwmaP = calcEwma(mgfairV, mgEwmaP, qpRepo["quotingEwmaProtectionPeridos"].get<int>());
EV::evUp("EWMAProtectionCalculator");
};
Expand Down

0 comments on commit a9fa5ac

Please sign in to comment.