-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Conversation
|
||
Note that all events from Gekko come from a plugin (with the exception of the `candle` event, which comes from the market), and no plugin is required for Gekko to run, this means it might be possible that some events are never broadcasted since their originating plugin is not active. If a plugin wants to listen to an event that will never be broadcasted (because of a lack of another plugin) this will be warned in the console like so: | ||
|
||
(WARN): Paper Trader wanted to listen to the tradingAdvisor, however the tradingAdvisor is disabled. |
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.
Are the extra spaces here intended?
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.
Yes! If you add 4 whitepaces in markdown it will convert it into a codeblock, see here for an example:
https://github.com/askmike/gekko/blame/develop/docs/strategies/creating_a_strategy.md#L13
&
https://gekko.wizb.it/docs/strategies/creating_a_strategy.html#Boilerplate-strategies
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.
Lol. Somehow I didn't think of the possibility that you wanted it to be a codeblock on purpose...
web/server.js
Outdated
client => client.send(JSON.stringify(data)) | ||
client => { | ||
try { | ||
client.send(JSON.stringify(data); |
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.
hm )
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.
that's a fix for #1582, not the best please to put it I admit ;)
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.
Ah you mean I forgot the )
, good point, adding it back now!
Current possible issue: AFAIK events behave as a FIFO stack which means that the following situation poses a problem: If there is a paper trader and a strat runner both subscribed to new candles to register current market start and for some reason (due to whichever order plugins are loaded) the strat runner is first to receive the new candle. In that case the plugins will execture in this order:
Current implemented workaround is that the advice payload is extended with a candle on which the advice is based. This works now since the current events are limited, but this solution does not scale, especially with the introduction of new events like The only solutions I see:
Anyone has any other ideas? @werkkrew @cmroche @AidasK? I won't work on this yet until I finished new event design (and basic implementation) |
@askmike A bit to go through here, I'll take a look in the next day or so. :) |
docs/internals/events.md
Outdated
- [portfolioChange](#portfolioChange-event): Every time the content of the portfolio has changed. | ||
- [portfolioTick](#portfolioTick-event): Every time the total worth of the portfolio has changed. | ||
- [report](#report-event): Every time the profit report has updated. | ||
- [roundtrip](#roundtrip-event): Every time a new roundtrip has been completed. |
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.
To consider for the future, events for adding/filling/canceling orders
this.defferedEvents = []; | ||
} | ||
|
||
util.inherits(GekkoEventEmitter, NativeEventEmitter); |
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 node 4.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!
Hey, don't want to bother, but I'd like know what's your take on modern Js synthax in general before commenting further. For example I saw a few usage of arrow functions here an there but it doesn't seem to be used everywhere it could. Cheers, keep up the good work :) |
@lutangar the codebase is quite big but I I want to use modern ES6 for all new code hitting the repo (including classes where it makes sense - especially for syntactical sugar). I am aiming to support the current LTS release which is node v8.11.1. |
Alright, I'll try to make a review in that way then. |
awesome, thanks! Keep in mind that this PR is still a WIP. Missing some
integration and a ton of unit tests.
…On Mon, May 14, 2018 at 2:54 PM, Johan Dufour ***@***.***> wrote:
Alright, I'll try to make a review in that way then.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1850 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA7MD17krKjVyUiewti4sc2lApxm0rzxks5tyX6agaJpZM4R4B78>
.
--
PGP key at keybase.io/mikevanrossum
<https://keybase.io/mikevanrossum/key.asc>
|
* Update performanceAnalyzer.js * Update logger.js * Update logger.js * Update performanceAnalyzer.js
c3e4f8e
to
c6faee1
Compare
See #2216 for follow up! Will clean up last things in there. |
fixes #1814 <- read the context and problem this solves here.
Currently not finished: if you run this now the UI will not be able to track what is happening in live gekkos.
TODO:
E2E flows: