This repository has been archived by the owner on Feb 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[WIP] 0.6 new gekko events #1850
Merged
Merged
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
dbb292a
add dedicated events page
askmike 95c8ffb
add events page
askmike 16d9673
streamline events intro
askmike fc4ac03
typo
askmike 7f41958
catch unsuccessful broadcast
askmike 28326bf
use gekko events for market start and market update
askmike 4c647e2
hook up plugins to market events
askmike c5dbb78
add eventLogger plugin
askmike 5e459c3
add additional strat events "stratStart" and "stratUpdate"
askmike c7aedf2
make sure to properly enclose broadcast catch wrap
askmike 875a3b1
rm stratStart event
askmike 7caf0d3
rm all stratEvent docs
askmike 9a4b2b1
remove stratStart subscription
askmike 0c35666
introduce portfolioChange & portfolioValueChange events
askmike 1af48aa
introduce events to describe trades async
askmike 08beb2b
add stratWarmupCompleted event
askmike 9ca7caf
implement stratWarmupCompleted
askmike d2a2146
implement stratUpdate event
askmike e78cfbb
error when plugins consume candles too slow
askmike 0d97570
make sure to callback after consuming candle
askmike d29f785
var cleanup
askmike 3993638
Fix issue with trade events being deferred too long
cmroche b722b17
force order of market events
askmike 410dff5
remove cpRelay out of performance analyzer
askmike 0eabf08
make sure we dont report on no trades
askmike decddd8
rm mentions of simulated
askmike eeec247
defer processCandle until the strat is completely done processing the…
askmike 505ed01
implement tradeInitialized & tradeCompleted events
askmike 4d52ca9
use a LIFO stack based event emittor
askmike d05b4fe
make all plugins fifo event emitters
askmike 350efd3
refer to blogpost with background information
askmike e7d7e56
add native gekko indicator results to stratUpdate event
askmike 59b5c70
implement roundtrip, roundtripUpdate & performanceUpdate events
askmike 587ddcb
properly catch no trade scenario
askmike 4df7af2
pass all plugins to gekkoStream
askmike 4995f22
pass all plugins into gekkostream
askmike 479d321
create plugin to handle backtest results
askmike 3847362
only wait for actual candle consumers to handle candles
askmike cea17ca
only flush events from plugins that actually emit
askmike a42e5a0
rm the id of the small candle
askmike 5e4d4d8
add stratCandle event
askmike 5e9c670
properly handle stratUpdates
askmike 674af1d
clarify strat events during warmup
askmike 0d6ce81
allow the exporting of raw trades
askmike 7bbb59c
hookup backtest UI to new event flow
askmike 6ae42a2
make sure to print cp final words
askmike a694b09
upgrade backtest API call to use backtestResultExporter plugin
askmike 2041cd2
update to new backtest api call
askmike 8e2760a
allow for specifying what candle props to return
askmike a639317
make sure we output the binance error, fix #2037
askmike c6faee1
Performance Analyzer fixes and features (#2178)
stereohelix f948a2d
define relativeYearlyProfit, fix #2190
askmike b080ff7
update required node version to 8.11.2
askmike 7358e55
run appveyor tests using node v9
askmike 52f6e5d
pull async indicator wrap code out of base strat
askmike 658bf76
remove cp.js
askmike e703963
Merge branch 'pre-v0.6' into feature/sync-gekko-events
askmike ea6df42
remove tulind & talib from default deps
askmike File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
language: node_js | ||
node_js: | ||
- "8.0.0" | ||
- "8.11.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Gekko uses a custom event emitter within the GekkoStream (the plugins) to guarantee | ||
// the correct order of events that are triggered by eachother. Turns sync events from | ||
// LIFO into a FIFO stack based model. | ||
// | ||
// More details here: https://forum.gekko.wizb.it/thread-56579.html | ||
|
||
const util = require('util'); | ||
const events = require('events'); | ||
const NativeEventEmitter = events.EventEmitter; | ||
|
||
const GekkoEventEmitter = function() { | ||
NativeEventEmitter.call(this); | ||
this.defferedEvents = []; | ||
} | ||
|
||
util.inherits(GekkoEventEmitter, NativeEventEmitter); | ||
|
||
// push to stack | ||
GekkoEventEmitter.prototype.deferredEmit = function(name, payload) { | ||
this.defferedEvents.push({name, payload}); | ||
} | ||
|
||
// resolve FIFO | ||
GekkoEventEmitter.prototype.broadcastDeferredEmit = function() { | ||
if(this.defferedEvents.length === 0) | ||
return false; | ||
|
||
const event = this.defferedEvents.shift(); | ||
|
||
this.emit(event.name, event.payload); | ||
return true; | ||
} | ||
|
||
module.exports = GekkoEventEmitter; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use ES6
extends
here, it's reference in the official doc and available since node4.9.1
https://node.green/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will do!