Dukascopy Support Board http://www.dukascopy.com/swiss/english/forex/jforex/forum/ |
|
IContext.executeTask() silently does nothing http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=16&t=55855 |
Page 1 of 1 |
Author: | mtnfx [ Mon 27 Nov, 2017, 19:21 ] |
Post subject: | IContext.executeTask() silently does nothing |
Hello, today I came across very strange and very critical problem - IContext.executeTask() silently does nothing while I modify orders. Problem occurs after restart of the strategy. After lengthy digging and experimenting I've found the cause - instance of IContext provided during first run was cached and reused at later restarts. The reason behind this is - I was trying to make some kind of unit test around my strategy, but it does not matter. So ... it seems that 'stopped' IContext can still be used (no exception is thrown in any method) and the only symptom of wrong usage is - "IContext.executeTask() silently does nothing". All other methods seem to be working without problems. I understand this is the rare case, but anyway, to save time of clients, please prevent usage if 'stopped' IContext to avoid hidden bugs. |
Author: | API Support [ Tue 05 Dec, 2017, 09:29 ] |
Post subject: | Re: IContext.executeTask() silently does nothing |
Please provide code that would reproduce the issue. |
Author: | mtnfx [ Tue 05 Dec, 2017, 17:42 ] |
Post subject: | Re: IContext.executeTask() silently does nothing |
API Support wrote: Please provide code that would reproduce the issue. Here it isNote: I expect some exception to be thrown at second invocation of 'g_context.openChart(fd);' and 'g_context.executeTask)'. Currently - second 'g_context.openChart()' successfully opens chart, - second 'g_context.executeTask()' silently does nothing - check strategy output messages. package jforex; |
Author: | API Support [ Wed 20 Dec, 2017, 11:29 ] | ||
Post subject: | Re: IContext.executeTask() silently does nothing | ||
This happens because each strategy run has different IContext object. Strategy has to use the correct IContext object that is passed into onStart method. See the amended strategy version in the attachment.
|
Author: | mtnfx [ Wed 20 Dec, 2017, 15:22 ] |
Post subject: | Re: IContext.executeTask() silently does nothing |
API Support, i known what i was doing wrong mtnfx wrote: ... After lengthy digging and experimenting I've found the cause - instance of IContext provided during first run was cached and reused at later restarts ... My point in this topic is - JForex API does not prevent such wrong usage, it rather silently partially works and because of that it is hard for a user to notice where and why problem occurs. |
Page 1 of 1 |