hi Support,
Please consider the below words in a positive and constructive manner. I do not mean to offense, I think that Dukascopy SDK support team is one of
the best out there in the retail business. I'm just looking for answers and solutions which are acceptable on both parties.
From the waitForUpdate documentation:
Quote:
waitForUpdate Blocks until order changes it's state, values or until timeout is elapsed (unblocks when system receives any message related to this order).
So in theory - I could be blocked for the max timeout period. In your example code 2 seconds per waitForUpdate. So in theory - I could be blocked for total 8 seconds. Things can go wrong. Network, Server or other issues might delay the response.
I don't see in your code example how you deal with such issues. For example - one order SL reset is OK, the other order SL reset fails. --> Merge fails. Now what? We have one order with no SL. How to protect from such scenario? We should always design for failure - as
Werner Vogels (CTO @Amazon) said
"...Everything fails, all the time"How do I deal with other open positions during that time?
From the documentation:
Quote:
All the ticks and bars that platform received while waiting will be dropped.
I cannot afford to implement a system which by design looses ticks, bars and messages. Maybe it is ok with other clients but not for my purpose. Please provide a more robust solution without data loss inherent by design.
In extreme conditions - the documentation even state that the strategy might stop working all together:
Quote:
waitForUpdate shouldn't be used for waiting long running events, like closing the order by stop loss, else buffer with messages will overflow and strategy will be stopped.
That is not acceptable. I need a non blocking solution.
You said:
Quote:
We don't deliberately provide anti-pattern API solutions
I can only say that the biggest ani-pattern when working in a single threaded model is using blocking code. Since the architecture of JForex is based on a single processing thread (Strategy thread) - the usage of methods such as waitForUpdate should be completely avoided .
Finally you said in regards to sending parallel SL updates on OrderA and orderB:
Quote:
in the current implementation the server does not support that.
Please provide more info - I know that for the same order there couldn't be SL consecutive updates in less than 1 second and that is ok. But why do you say that I cannot send parallel SL updates for two separate orders? what would happen in that case?