I do not manage to get processTradeCompleted event working, can you please help? - Printable Version +- Gekko Forum (https://forum.gekko.wizb.it) +-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html) +--- Forum: Technical Support (https://forum.gekko.wizb.it/forum-19.html) +--- Thread: I do not manage to get processTradeCompleted event working, can you please help? (/thread-57900.html) |
I do not manage to get processTradeCompleted event working, can you please help? - philipina - 04-14-2019 Hello, I now study Gekko for 2 weeks and have written my first strategy. It is working in general but I would like to monitor processTradeCompleted event to make sure that my strategy can react properly in case of error (e.g. trade cancelled, errored). I have to say that I'm not a javaScript specialist, so, I probably did not code the implementation properly. When my code runs I do not have exceptions but also I do not get the processTradeCompleted event, Here attached I have attached my strategy. There are lots of comment in it and I hope it is easy to understand. Could someone help me to solve my problem? This should not be a big issue. So far you could take a look at the "Plugin.prototype.processTradeCompleted" in the attached strategy. Thanks in advance for your support and thanks again GEKKO RE: I do not manage to get processTradeCompleted event working, can you please help? - crypto49er - 04-16-2019 Wow. You spent a lot of time writing this strategy. Nice to see the effort you're putting in for your own strategy. The reason why processTradeCompleted is not working is probably that it is already declared in tradingAdvisor. TradingAdvisor works with baseTradingMethod and your strategy to participate in the event system that Gekko uses to pass information between all the various components. This video should help explain this process. https://www.youtube.com/watch?v=lc21W9_zdME RE: I do not manage to get processTradeCompleted event working, can you please help? - philipina - 04-17-2019 Hello Crypto49er, Thanks for your answer. Actually it took me 6 days working 2 hours per day on it in the evening. It is not yet finished but I already start playing with it in paper trading mode. I saw your video already before and it was very helpfull. I'm now using onTrade event and this is working but the only problem with it is that I'm not able to differentiate if the order was placed or not. Or at least, so far, I could not simulate a case where the order did not got through and generates an error. I would like to do that to see if the onTrade event will also be raised or not, and if so, with which content. Did you ever receive a onTrade event for the failing order? A the end, what I want to make sure, is that my bot will stop if anything goes wrong instead of emptying my account bny generating errors and bad trades RE: I do not manage to get processTradeCompleted event working, can you please help? - crypto49er - 04-18-2019 No. OnTrade is only called when the processTradeCompleted event occurs. I ended up creating the onTerminatedTrades method in my smart strategy template (also modified baseTradingMethod & tradingAdvisor to get that to work) to get alerted when trades abort or error out. You might have seen the video about that, but if you haven't, it's here. https://www.youtube.com/watch?v=xwfYkgOjTFE RE: I do not manage to get processTradeCompleted event working, can you please help? - philipina - 04-18-2019 Just had a look at it. Thanks a lot. This is a great video. THANKS THANKS THANKS |