Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ALGO transfers via TRADE struct manipulation #487092
01/15/23 16:01
01/15/23 16:01
Joined: Jan 2021
Posts: 4
Austin, TX, USA
J
Jack_Zodiac Offline OP
Guest
Jack_Zodiac  Offline OP
Guest
J

Joined: Jan 2021
Posts: 4
Austin, TX, USA
Hello,
I am working on a script that has both counter-trend and trend-follower component ALGOs. Not infrequently the trend-follower wants to start buying before, or at the same time as, the CT ALGO wants to sell. So it would be desirable to hand off lots between the ALGOs without buying/selling to market. While preserving Zorro's profit statistics for each ALGO. (I.e., as if there had been a cost-less sell/buy at the average bar price)

So the question: is it possible (or advisable) to try to handle this by selecting an open TRADE of the lot-holding ALGO and decrementing its lots, and then entering (or lot-incrementing, if open) a TRADE of the lot-receiving ALGO. (Or if that won't work directly, cancelling an existing TRADE and entering an altered one.) And then what components of the modified TRADE structs will Zorro update for me, and what do I have to figure out & also update manually (open/closed flags, profit, entry/exit prices, etc.) to preserve profit stats and otherwise not mess things up?

Thanks in advance for any insights!

Last edited by Jack_Zodiac; 01/15/23 16:03. Reason: clarifying
Re: ALGO transfers via TRADE struct manipulation [Re: Jack_Zodiac] #487097
01/16/23 13:43
01/16/23 13:43
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
You're right in avoiding simutaneous long and short positions of the same asset. But you need no special code for that, simply set Hedge = 5.

Re: ALGO transfers via TRADE struct manipulation [Re: Jack_Zodiac] #487100
01/16/23 15:57
01/16/23 15:57
Joined: Jan 2021
Posts: 4
Austin, TX, USA
J
Jack_Zodiac Offline OP
Guest
Jack_Zodiac  Offline OP
Guest
J

Joined: Jan 2021
Posts: 4
Austin, TX, USA
Thanks for the pointer!

Is the difference between virtual hedging and TR_PHANTOM TradeMode, that in TR_PHANTOM mode the phantom trades are not collected into the pool trades that the broker receives?

Re: ALGO transfers via TRADE struct manipulation [Re: Jack_Zodiac] #487109
01/19/23 16:01
01/19/23 16:01
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Exactly. TR_PHANTOM does not affect pool trades.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1