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.
API Support
Post subject: Re: IContext.executeTask() silently does nothing
Please provide code that would reproduce the issue.
Here it is Note: 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.
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.
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on
this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control
on their content. Anyone accessing this webpage and downloading or otherwise making use of any document,
data or information found on this webpage shall do it on his/her own risks without any recourse against
Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from
the use and/or reliance on any document, data or information found on this webpage.
mtnfx
Post subject: Re: IContext.executeTask() silently does nothing
... 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.