Gamestudio Links
Zorro Links
Newest Posts
Max Number of Strategies in /Strategy folder
by Martin_HH. 06/16/26 09:02
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
Zorro 3.01 recoded MMI function issue
by 11honza11. 06/13/26 11:40
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
Z9 getting Error 058
by k_ivan. 06/10/26 14:38
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (Martin_HH, Grant, TipmyPip, 1 invisible), 1,315 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Calculate Open Lots for Different Algo Without Executing Trades #488454
12/03/24 07:56
12/03/24 07:56
Joined: Apr 2023
Posts: 61
V
vicknick Offline OP
Junior Member
vicknick  Offline OP
Junior Member
V

Joined: Apr 2023
Posts: 61
I have a script that runs two Algo (Algo A & B) that calculates daily optimal position for each Algo, then open or close trades accordingly.

For example on Monday, optimal position for Algo A = 3, Algo B = 0. If on Tuesday, optimal position is Algo A = 4, Algo B = 1, then the script will calculate net position is 2 long: (4 - 3) Algo A + (1 - 0) Algo B.

However if on Tuesday, optimal position is Algo A = 4, Algo B = -1, then the script will calculate net position is 0: (4 - 3) Algo A + (-1 - 0) Algo B. Thus, the script will not open or close any position.

But since no trades is being made, the script will consider the number of open trades for each Algo remains the same (Algo A = 3, Algo B = 0), even though it should be Algo A = 4, Algo B = -1.

How do you make Zorro to consider the number of open trades for each Algo without executing trades?

Re: Calculate Open Lots for Different Algo Without Executing Trades [Re: vicknick] #488455
12/03/24 15:34
12/03/24 15:34
Joined: Feb 2017
Posts: 1,819
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,819
Chicago
With Zorro hedge modes 5 and 6. With 6, explicitly call the tradeUpdate() function to execute balancing trades.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1