Listening for trade events in strategy ?
how am I supposed to register handler for `tradeInitialized`, `tradeCompleted`... events within my strategy file?
I have tried this.on('tradeInitialized', <callback>) and this.addListener('tradeInitialized', <callback>) but nothing gets ever called, I have console.log() in the callback function but it never writes to console. 
Thx for any advice
Hey! Within Gekko there are plugins: these are the main internal modules. Information is shared between them via events.

Note that your strategy is not a plugin (but it's wrapped inside a plugin). The plugins & event system is used internally as well as for external "plugins" (telegram bot, etc).


That said: the tradeCompleted event is exposed to your strategy. You can create a function called onTrade which will receive the tradeCompleted event. If you need more events let me know and we figure out a clean interface for that.
<form debug test>

Forum Jump:

Users browsing this thread: