Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Quad, TipmyPip, degenerate_762, AndrewAMD, Nymphodora), 997 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Broker / Zorro position synchronization #477754
07/26/19 14:13
07/26/19 14:13
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
I have some questions about synchronizing Zorro's phantom trade position, pool position, and broker position.

This is for a stock trading system, NFA mode with Hedge = 5.

Allow me to propose some scenarios. My question for each is how to synchronize all of the positions? Assume we are talking about a single stock, say AAPL.

#1 - Broker position is 0, phantom trades are at +10, pool trade are at +10. I should cancel all open trades, including phantom and pool, correct?

#2 - Broker position is +10, phantom trades are at 0, pool trades are at 0. Is there some way I can inject a "trade", which when opened sends nothing to the broker, but when closed will actually close my position? So that it could be +10 +10 +10, and then closing the injected phantom trade will bring it all to 0 0 0.

Re: Broker / Zorro position synchronization [Re: AndrewAMD] #477759
07/26/19 15:25
07/26/19 15:25
Joined: May 2018
Posts: 134
S
SBGuy Offline
Member
SBGuy  Offline
Member
S

Joined: May 2018
Posts: 134
Sounds like we have a similar problem :-)

I haven't quite solve it yet but will work on it soon. My current thought is this:

- enter the trade as a phantom trade, so it is tracked inside Zorro
- when Zorro exits this trade, I would send a special brokerCommand to my custom broker plugin to close the trade.

My specific senario is when a short put is assigned by the broker, I want to track and close it as a long stock, under a long stock TMF.

I'm look forward to seeing other responses

Re: Broker / Zorro position synchronization [Re: AndrewAMD] #477760
07/26/19 16:52
07/26/19 16:52
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
If your plugin is NFA, there is no need for a special brokerCommand. In that case, BrokerBuy2 is being used to change your position from A to B.

Anyways, my question is about Zorro scripting.

Question #3: I see that LotsPool is read-only. How often is it updated? Is there a way to force this value to update?

Question #4: On that note, how exactly does Zorro calculate the size of its pool? I don't suppose it iterates through the trade structs in some fashion?

Re: Broker / Zorro position synchronization [Re: AndrewAMD] #477774
07/27/19 09:32
07/27/19 09:32
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
I think for 1 yes, cancel the trades. For killing a broker position I would enter a short position and then also cancel both trades.

Re: Broker / Zorro position synchronization [Re: Petra] #477779
07/27/19 17:08
07/27/19 17:08
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Originally Posted by Petra
I think for 1 yes, cancel the trades. For killing a broker position I would enter a short position and then also cancel both trades.

But which trades?

#5) If I only cancel the phantom trades and not the pool trades, what happens?
#6) If I only cancel the pool trades and not the phantom trades, what happens?
#7) If I only cancel both the pool trades and the phantom trades, what happens?


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1