mkmarek / forex.analytics Goto Github PK
View Code? Open in Web Editor NEWNode.js native library performing technical analysis over an OHLC dataset with use of genetic algorithm
License: MIT License
Node.js native library performing technical analysis over an OHLC dataset with use of genetic algorithm
License: MIT License
I have some (dummy) candlestick data with an interval of 30mins:
const orig = [
{
open: 1.11399,
high: 1.11399,
low: 1.11389,
close: 1.11389,
time: 1435701600
},
{
open: 1.11389,
high: 1.83321,
low: 1.10213,
close: 1.76,
time: 1437501600
}
];
I am trying to convert that to 1 hour candlesticks. I assume it should return an array of 1 candlestick because my original data set has 2 candles of 30 minutes. I convert it as follows:
function convertTo1HOhlc(candlesticks) {
return analytics.convertOHLC(candlesticks, 3600);
}
console.log(convertTo1HOhlc(orig));
That outputs the following:
[ { open: 1.11399,
low: 1.11389,
high: 1.11399,
close: 1.11389,
time: 1435701600 },
{ open: 1.11389,
low: 1.10213,
high: 1.83321,
close: 1.76,
time: 1437501600 } ]
This does not look correct to me.
Is this a bug? Or am I missing something?
Tried with:
OSX 10.11.x
OSX 10.12.3
Result:
../src/functions/findStrategy.cpp:58:5: error: initializer 'AsyncProgressWorker' does not name a non-static data
member or base class; did you mean the base class 'AsyncProgressWorkerBase'?
: AsyncProgressWorker(callback_)
^~~~~~~~~~~~~~~~~~~
AsyncProgressWorkerBase
../src/functions/findStrategy.cpp:52:33: note: base class 'Nan::AsyncProgressWorker' (aka
'AsyncProgressWorkerBase') specified here
class FindStrategyAsyncWorker : public Nan::AsyncProgressWorker
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/analytics/src/functions/findStrategy.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/user/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
Hey,
currently, zenbot, a cryptocurrency trading bot, is evaluating two different genetic optimization approaches.
It would be very interesting to not only optimize the selection of indicators for buy/sell decision, but also optimize the lengths of the lookback period for those decisions. Currently the length is fixed, for example at 14 for RSI.
Is forex.analytics still actively maintained and would this be in the scope of development?
Thanks!
-crubb
LINK : fatal error LNK1181: cannot open input file '..\lib\ta-lib\lib\ta_libc_csr.lib' [C:\Users\kenke\Projects\zenbot\node_modules\forex.analytics\build\analytics.vcxproj]
Hi !
Can you commit the branch without talib in stable please ?
I cant use talib on windows and wich to use your work with @askmike gekko
Thank you
Mac OS
node-gyp is installed
Clone repo and run npm install
Build failure on FindStrategy.o
CXX(target) Release/obj.target/analytics/src/functions/findStrategy.o ../src/functions/findStrategy.cpp:58:5: error: initializer 'AsyncProgressWorker' does not name a non-static data member or base class; did you mean the base class 'AsyncProgressWorkerBase'? : AsyncProgressWorker(callback_) ^~~~~~~~~~~~~~~~~~~ AsyncProgressWorkerBase ../src/functions/findStrategy.cpp:52:33: note: base class 'Nan::AsyncProgressWorker' (aka 'AsyncProgressWorkerBase<char>') specified here class FindStrategyAsyncWorker : public Nan::AsyncProgressWorker ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [Release/obj.target/analytics/src/functions/findStrategy.o] Error 1
Warning 1 warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\concrt.h 313 1 analytics
Error 2 error C3861: '__uncaught_exception': identifier not found C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\concrt.h 4774 1 analytics
Warning 3 warning C4244: '=' : conversion from 'const double' to 'long', possible loss of data C:\Users\Pascal\git\forex.analytics\src\cpp\TradingSimulator.cpp 33 1 analytics
Warning 4 warning C4244: '=' : conversion from 'const double' to 'long', possible loss of data C:\Users\Pascal\git\forex.analytics\src\cpp\TradingSimulator.cpp 80 1 analytics
Warning 5 warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\concrt.h 313 1 analytics
Error 6 error C3861: '__uncaught_exception': identifier not found C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\concrt.h 4774 1 analytics
Warning 7 warning C4244: 'initializing' : conversion from 'double' to 'unsigned int', possible loss of data C:\Users\Pascal\git\forex.analytics\src\cpp\BinaryTreeGeneticAlgo.cpp 45 1 analytics
Warning 8 warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data C:\Users\Pascal\git\forex.analytics\src\cpp\nodes\IndicatorTreeNode.cpp 16 1 analytics
Error 9 error C2512: 'Nan::AsyncProgressWorkerBase' : no appropriate default constructor available c:\users\pascal\git\forex.analytics\src\include\export\findStrategy\FindStrategyAsyncWorker.h 18 1 analytics
Error 10 error C2614: 'FindStrategyAsyncWorker' : illegal member initialization: 'AsyncProgressWorker' is not a base or member c:\users\pascal\git\forex.analytics\src\include\export\findStrategy\FindStrategyAsyncWorker.h 18 1 analytics
Warning 11 warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc c:\users\pascal\git\forex.analytics\src\include\export\findStrategy\FindStrategyAsyncWorker.h 42 1 analytics
12 IntelliSense: "AsyncProgressWorker" is not a nonstatic data member or base class of class "FindStrategyAsyncWorker" c:\Users\Pascal\git\forex.analytics\src\include\export\findStrategy\FindStrategyAsyncWorker.h 17 5 analytics
13 IntelliSense: no default constructor exists for class "Nan::AsyncProgressWorkerBase" c:\Users\Pascal\git\forex.analytics\src\include\export\findStrategy\FindStrategyAsyncWorker.h 18 2 analytics
Trying to install on Ubuntu 16.04LTS
node: v7.5.0
npm: v4.1.2
node-gyp: v3.5.0
get the following error:
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:192:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.0-63-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /home/genx/gekko/node_modules/forex.analytics
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
npm ERR! Linux 4.4.0-63-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "forex.analytics"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: node-gyp configure && node-gyp build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node-gyp configure && node-gyp build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the forex.analytics package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure && node-gyp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs forex.analytics
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls forex.analytics
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/genx/gekko/npm-debug.log
See attached debug log. Any help is much appreciated :)
First of all thanks for this awesome project!
I am looking into using this project to come up with strategies for cryptocurrency markets, and for that I have a few questions:
high
of that candle, is there any reasoning behind this (I guess worst case scenario)?Thanks!
Mike
CI Job ID: #339849087 (line 583 and so on)
../src/../include/nodes/OperatorTreeNode.h:7:21: warning: ‘OperatorStrings’ defined but not used [-Wunused-variable]
static const char * OperatorStrings[] = { "And", "Or", "Xor"};
^
In file included from ../src/BinaryTreeChromosome.cpp:5:0:
../src/../include/nodes/IndicatorTreeNode.h:5:21: warning: ‘SignStrings’ defined but not used [-Wunused-variable]
static const char * SignStrings[] = { ">", "<" };
^
In file included from ../src/nodes/TreeNode.cpp:4:0:
../src/nodes/../../include/nodes/OperatorTreeNode.h:7:21: warning: ‘OperatorStrings’ defined but not used [-Wunused-variable]
static const char * OperatorStrings[] = { "And", "Or", "Xor"};
^
In file included from ../src/nodes/TreeNode.cpp:5:0:
../src/nodes/../../include/nodes/IndicatorTreeNode.h:5:21: warning: ‘SignStrings’ defined but not used [-Wunused-variable]
static const char * SignStrings[] = { ">", "<" };
^
The first call findStrategy returns result as expected, but second or more call returns a strategy with fitness 0.
Thanks for this great library.
Been running on multiple markets outside of forex such as stocks and other currencies. Is there an indicator that is hard coding a PIP value somewhere? I am getting outputs with values for indicators that make zero sense or are impossible so wondering if it is skewed up a bit since the prices are much higher than forex. Also, the indicators don't seem to line up.
For example, I compiled a list of 1 year of minute candle data. I applied this and ran the example. js.
Issues
Lastly, does this output translate to indicators to apply on a 30 minute time frame since that is the conversion used in the example.js file??
I already have windows-build-tools through npm
When installing forex.analytics I encounter this error:
LINK : fatal error LNK1181: cannot open input file '..\lib\ta-lib\lib\ta_libc_csr.lib' [C:\Users\user1\Desktop\FAn\forex.analytics-master\build\analytics.vcxproj] gyp ERR! build error gyp ERR! stack Error:
C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
I've checked the repo and there is no ta_libc_csr.lib file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.