Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Threaded neural strat. This time it works :) #718

Merged
merged 24 commits into from Nov 21, 2017
Merged

Threaded neural strat. This time it works :) #718

merged 24 commits into from Nov 21, 2017

Conversation

ghost
Copy link

@ghost ghost commented Nov 16, 2017

Threaded neural strat. This time it works :)

Thanks for everyone and all for inspiration in creating this.
Thanks to Harvard for the code.
Thanks to NodeJS for including clustering in nodejs8!
Thanks to GNU parallel for main inspiration.

Thanks to zenbot, deviavir, carlos8f, the weather man, VertigoRay, OpticTrollz, BruceTus, BobTheSiaCoinGuy, that Japanese guy from napajs that I feel sorry for. Thanks for keeping me sane through coding these strategies. Also thanks for my main inspiration, weather prediction and sliding max-min algorithm for developing the signaling I call sliding 2/3ds averaging prediction.

Please comment, and review as I'd love to have this PR.

Thanks to JensvdHeydt for helping with the speed issue and net creation too! :)

Cluster module is native in nodejs8. Please dev test this for me guys! :) Predict some neural strategies!!

Jacob McQueen and others added 17 commits November 15, 2017 09:57
…alculation across multiple cores. It can serve as an example for others trying to

expand the capabilities of nodejs.
Credits:

Brucetus for being a cool dude. Sorry I couldn't help with hitbtc for those 0.01% refunds!!!!
Harvard for the code: http://cs.stanford.edu/people/karpathy/convnetjs/docs.html
Personal inspiration.
Nodejs for including clusters in nodejs8! And symbols support with limited global variables.
Everyone else that helped me along the way threading and coding this neural strategy.
GNU Parallel for inspiration: https://www.gnu.org/software/parallel/
And all you other folks! Especially that fellow that learned me on how much processing power it takes to create a neural net.

Sincerely,
JM/TRK
For some reason this is far more profitable config
…statement preroll periods to require trade data or something.
@JensvdHeydt
Copy link
Contributor

JensvdHeydt commented Nov 17, 2017

@TheRoboKitten Thx for taking about 70% of the code that I rewrote for you or better: Thanks for using my coding without giving any form of credit.

Another thing: you are using the cluster feature but it looks like all your forks do the same work in the neural strategy. Where in the code does it divide the work between all those forks it generates?

conf-sample.js Outdated
@@ -11,9 +11,9 @@ c.mongo.password = null
c.mongo.replicaSet = null

// default selector. only used if omitting [selector] argument from a command.
c.selector = 'gdax.BTC-USD'
c.selector = 'gdax.LTC-USD'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think BTC is a bit more common.

conf-sample.js Outdated
// name of default trade strategy
c.strategy = 'trend_ema'
c.strategy = 'trendline'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you that confident that it should become the new default?

const numCPUs = require('os').cpus().length;
// the below line starts you at 0 threads
global.forks = 0
// the beow line is for calculating the last mean vs the now mean.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: below

package.json Outdated
"cexio-api-node": "^1.0.4",
"cliff": "^0.1.10",
"codemap": "^1.3.1",
"colors": "^1.1.2",
"commander": "^2.9.0",
"convnetjs": "0.3.0",
"ccxt": "^1.4.77",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You downgraded this from 1.10 to 1.4

@JensvdHeydt
Copy link
Contributor

Strategy "trendline". Something is broken. Thats trading in paper mode

2017-11-19 11:31:55 6649.75 BTC-EUR 0.00% 0 61 ++ NaN sell 0.00000 BTC 1000.00 EUR +0.00% -0.01%
2017-11-19 11:32:00 6645.85 BTC-EUR -0.06% 0 - 47 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:32:20 6645.84 BTC-EUR 0.00% 1 - 47 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:32:25 6645.85 BTC-EUR +0.00% 0 - 47 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:32:35 6645.84 BTC-EUR 0.00% 0 - 47 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:32:40 6645.85 BTC-EUR +0.00% 0 - 47 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:32:50 6645.85 BTC-EUR +0.00% 0 - 47 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:33:00 6645.84 BTC-EUR 0.00% 0 - 47 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:33:05 6645.84 BTC-EUR +0.00% 0 - 47 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:33:10 6645.85 BTC-EUR +0.00% 0 - 47 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:33:40 6645.80 BTC-EUR 0.00% 0 - 46 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:33:45 6645.51 BTC-EUR 0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:33:50 6645.50 BTC-EUR 0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:33:55 6645.50 BTC-EUR +0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:34:05 6645.51 BTC-EUR +0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:34:10 6645.51 BTC-EUR +0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:34:15 6645.51 BTC-EUR +0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:34:20 6645.51 BTC-EUR +0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:34:25 6645.51 BTC-EUR +0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:34:35 6645.50 BTC-EUR 0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:34:40 6645.51 BTC-EUR +0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%
2017-11-19 11:34:45 6645.51 BTC-EUR +0.00% 0 -- 45 NaN sell 0.00000 BTC 1000.00 EUR +0.00% +0.05%

@ghost
Copy link
Author

ghost commented Nov 19, 2017

Strategy "trendline". Something is broken. Thats trading in paper mode
Increase min_periods to something very very larger than the avgtrades/long part of the trendline.
@ 1 s period not enough trades in s.lookback[s.options.min_periods] when it starts calculating and then will error at 1000 average/long trades & 1000 min_periods.

Personally try run at min_periods 4000 and then average 105 and short 5 with .1 markup. 👍

@TheRoboKitten Thx for taking about 70% of the code that I rewrote for you or better: Thanks for using my coding without giving any form of credit.

Another thing: you are using the cluster feature but it looks like all your forks do the same work in the neural strategy. Where in the code does it divide the work between all those forks it generates?

This needs to be fixed I admit, I was going to give you credit but I am bad with names.

I am considering removing the threaded code, or simply, set your threads to 1 for now. I'll set as default. :) 🔢

@ghost
Copy link
Author

ghost commented Nov 19, 2017

If you want the PR take it or leave it. I have no future plans to support zenbot due to nodejs limitaitons.

@vitorego
Copy link

I´m using the trendline strategy and it is good. For BTC-EUR on gdax need to change the default options, but is having good results on paper mode.

@JensvdHeydt
Copy link
Contributor

@vitorego I think the trendline strategy is interesting. It just needs some polishing because it gave me undefined values as trade statistic and that's not very trustworthy :)

@halvors
Copy link

halvors commented Nov 20, 2017

@vitorego What options where you using?

@vitorego
Copy link

vitorego commented Nov 20, 2017

@halvors:
./zenbot.sh trade --strategy=trendline --min_periods=200 --avgpoints=100 --lastpoints=10 --period=30m gdax.BTC-EUR.default"

@vitorego
Copy link

@JensvdHeydt I also got that error on bitfinex using pair IOT-USD. I used the same options as I used for gdax pair BTC-EUR:

1786 ./zenbot.sh sim --verbose --strategy=trendline --min_periods=200 --avgpoints=100 --lastpoints=10 --period=30m --days=15 bitfinex.IOT-USD

@mkuendig
Copy link
Contributor

mkuendig commented Nov 21, 2017

have this PR running on my zenbot but no actions after 36 hours:

./zenbot.sh trade poloniex.STR-BTC --strategy neural

It has started to trade now. Had to reboot the container. However, now it trades too often on very tiny profits and too often after exchange fee the trade is negative.

Copy link
Owner

@DeviaVir DeviaVir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, I'll merge so we get more eyes on these strats.

@DeviaVir DeviaVir merged commit f1a1f51 into DeviaVir:master Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants