Phantom/Pool Order Sync

Posted By: MatPed

Phantom/Pool Order Sync - 09/08/17 08:10

Hi,
I have already raised this question and the answer received was not very clear to me and issue occurs again. Hopefully this example will help me to clear out the point
Attached a log file where my TS open an order with Hedge =5
Phantom trade is opened, pool trade fail.
Now I have a phantom Trade open and no Pool trade.
bars are passed and no synchronization happened.

Which is the best way to handle this situation? Thank you.

Attached File
mpCL105mreal.zip  (77 downloads)
Posted By: DdlV

Re: Phantom/Pool Order Sync - 09/08/17 12:39

Hi MatPed,

I have had the same situation, and it eventually does sync. I believe the issue is the sync code is embedded within the trade opening code, so if bars go by with no new trade for that asset, the sync code is not executed.

Hopefully jcl can confirm this, and also explain why the sync code can't be pulled out to be more global and executed on each bar (or more frequently?). Or perhaps this could be an enhancement request?

Regards.
Posted By: MatPed

Re: Phantom/Pool Order Sync - 09/08/17 14:11

yes I agree. Unfortunately, up to now the phantom trade is living its own life with no the corresponding pool one.
I hope we will find a solution...
Posted By: jcl

Re: Phantom/Pool Order Sync - 09/08/17 15:16

I can confirm that it syncs when opening a new trade.

The reason of that is a situation where you want to manually close trades. If if would sync immediately, the trades would be just reopened. For preventing this, the reopening is delayed until the next trade. If you've set Margin to 0, they are never reopened.
Posted By: MatPed

Re: Phantom/Pool Order Sync - 09/09/17 16:48

Thank you Jcl,
but how to deal with this?
Is there a way to force a re-sync, from the script? I can than issue a command from a Panel and re-sync only when such errors occur...
I am open to other suggestion, but I'd like to dig into that. Such errors never happen when you train or test a script, because the trades are always opened.

Ciao
Posted By: DdlV

Re: Phantom/Pool Order Sync - 09/10/17 02:18

Hi jcl.

I don't really follow the logic of the reason. A delay of the resync until a new trade is added is just that - a delay. It doesn't really accomplish/respect a user's supposed manual wish any longer, does it?

MatPed makes a good point regarding having Trade function like Test does.

More generally, isn't there a deeper issue here? Zorro is an automated trading system. Isn't it inherent therein that Zorro should at all times be doing just that and keeping things in sync as quickly as it can?

Put another way, if the user wants to do something manual, then isn't s/he by definition in conflict with Zorro's purpose, & shouldn't s/he at that point be stopping Zorro and sorting out whatever the issues are?

If there are cases to be made for both directions, it would seem to me this should be an .ini option like VHImmediateSync = True if Zorro is to be in charge & keep things in sync at all times; or False if Zorro is to only sync on a new trade.

Regards.
Posted By: MatPed

Re: Phantom/Pool Order Sync - 09/10/17 13:23

Yes DdlV a flag will be perfect!
Posted By: kmerlo

Re: Phantom/Pool Order Sync - 09/11/17 07:23

Originally Posted By: MatPed
Yes DdlV a flag will be perfect!

me too I think should be a good feature
Posted By: MatPed

Re: Phantom/Pool Order Sync - 09/11/17 08:24

Jcl just a confirmation.
New trades have been opened with different assets. But the missed trade have not be synced.
As DdlV has stated in order to be re-synced a new trade on the same asset has to be opened. Correct?

Thank you
Posted By: jcl

Re: Phantom/Pool Order Sync - 09/11/17 09:23

That's right. But a flag to enforce re-syncing could make sense.
© 2024 lite-C Forums