Gamestudio Links
Zorro Links
Newest Posts
MT4/5 Bridge: Stability & Latency?
by Zheka. 02/28/21 15:05
Zorro - import diff time zones csv
by Neb. 02/28/21 12:23
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/26/21 13:15
MACD / Stoch useage
by TraderTom. 02/25/21 21:22
findContract not finding a contract
by AndrewAMD. 02/25/21 11:53
New Zorro version 2.35
by jcl. 02/24/21 14:40
AUM Magazine
Latest Screens
Scheherazade's Journey
Paradox Vector
The Space Between
Pogostuck: Rage With Your Friends
Who's Online Now
9 registered members (Lozoteva, OptimusPrime, 1ND1G0, TraderTom, Dooley, AndrewAMD, 3run, NewBorn, 1 invisible), 480 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
VinVillin, Santofimio, LorraineJones, SkNiX, wongkrezi
18601 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Zorro vs Oanda: Lot sizes do not match #482159
01/04/21 12:35
01/04/21 12:35
Joined: Nov 2020
Posts: 5
M
MMK Offline OP
Newbie
MMK  Offline OP
Newbie
M

Joined: Nov 2020
Posts: 5
Dear all,

I am running Z2 on an Oanda demo account without hedging.

Everything works fine, but for one USD/CAD trade the information in Zorro and the Broker do not match.

Zorro:
[USD/CAD:HP:S00186] ID 186 Lots 840
And
[USD/CAD:HP:S00192] ID 192 Lots 843

Oanda account:
ID 186 USD/CAD 465 Short
ID 192 USD/CAD 843 Short

As you can see the lot sizes do not match.

The Oanda support was not helpful (for me):
"Therefore when you have Sell order 840 units , you placed a Buy order of 375 units , it will offset the original Sell order ( Ticket 186)"

But according to the logs a trade for 375 units has not been triggered.
Also no change on trade 186 is listed in the Zorro log.

I have identified one log entry (the line with Error 075) that could be related to the problem:

[Thu 20-12-31 20:03] 99962 -26.46 -10.24 6/5 (1.22108)
(USD/CAD:CY:L) Long 1207@1.27398 Entry limit
!position closed by reversal
Error 075 (USD/CAD:CY:L) - can't open 1207@0.0 Stop 0.079591 at 20:03:27
[USD/CAD:HP:S00155] Closed 832@1.27396: +2.12 at 20:03:35
Market closed on 01-01 00:00:00 (local 00:00)
Market open on 01-03 23:00:01 (local 23:00)

Full log is attached to this post.

The manual says:
"Oanda accounts require special settings. They are NFA compliant, but Oanda works around most NFA issues on their side of the API, so the NFA flag needs not be set. Hedge must be either disabled (Hedge = 0) or in virtual hedging mode (Hedge = 4 or 5), otherwise closing trades will cause error messages.
and
"Compliance of the account. Affects default state of NFA flag and Hedge mode: 0 for no restrictions, 2 for Hedge = 0 (no hedging), 14 or 15 for NFA = on (full NFA compliance)."

Could it be that I have not configured the z.ini correctly?
Which combination of NFA and Hedge is correct for Oanda in the z.ini?
Is it NFA=2 and Hedge=0 or NFA=0 and Hedge=0?

Right now I do not see why the lot sizes do not match in Zorro and on the broker account.
I assume it has something to do with non-hedging on the Oanda account, but I am just too blind to see it. frown
Can someone give me a hint?

Thanks a lot for your help!


Attached Files
Last edited by MMK; 01/04/21 18:37.
Re: Zorro vs Oanda: Lot sizes do not match [Re: MMK] #482208
01/12/21 12:40
01/12/21 12:40
Joined: Nov 2020
Posts: 5
M
MMK Offline OP
Newbie
MMK  Offline OP
Newbie
M

Joined: Nov 2020
Posts: 5
Solved it partially (mea culpa -> RTFM! wink )

NFA=0 (NFA Flag must not be set)
Hedge=0 (no hedging)
Hedge=4 or 5 (virtual hedging, ZorroS required)

But the question concerning the lot size remains.
My understanding is that Zorro synchronizes lot sizes via the API. When restarting Zorro the resumed positions are listed, but the lot size displayed is not the one I see in my Oanda account:

Zorro:
[USD/CAD:HP:S00192] - resumed (843 lots)

Oanda:
ID 186 USD/CAD 465 Short

My plan is just to wait until Zorro tries to close the trades with an error message and than closing the trade manually on the broker platform.

Is there no other way to synchronize the open trades between Zorro and the broker via the API?

Cheers
Michael

Re: Zorro vs Oanda: Lot sizes do not match [Re: MMK] #482246
01/16/21 13:17
01/16/21 13:17
Joined: Apr 2008
Posts: 335
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 335
Austria
I don't think that Zorro tries to synchronize lot sizes, it only checks if a trade with this ID ending with 00192 exists and resumes it then. If Zorro closes that trade it will be completely closed, regardless of lot sizes. Only when you close it partially it will be a problem.

Re: Zorro vs Oanda: Lot sizes do not match [Re: Petra] #482264
01/19/21 13:39
01/19/21 13:39
Joined: Nov 2020
Posts: 5
M
MMK Offline OP
Newbie
MMK  Offline OP
Newbie
M

Joined: Nov 2020
Posts: 5
Thanks a lot for your answer!

In the meantime the same thing happended again with a different trade:

(GBP/USD:CX:L) Long 434@1.35891 Entry limit
!position closed by reversal
Error 075 (GBP/USD:CX:L) - can't open 434@0.0 Stop 0.075288 at 00:22:28

The pending trade above change the lot size of trade 181:
Zorro shows the lot size to be 879 lots:
Trade ID Lots Entry time
[GBP/USD:CT:S00181] 181 879 12-16 12:03

Oanda shows a new lot size of 445 Lots for ID 181.

I have set NFA=0 and Hedge=0 as stated in the manual. Therefore no hedging is allowed.

Why does Zorro create a Long trade when Short trades for GBP/USD are still open? The Hedge=0 shoud have prevented this, right?

confused

Last edited by MMK; 01/19/21 14:28.
Re: Zorro vs Oanda: Lot sizes do not match [Re: MMK] #482269
01/21/21 16:42
01/21/21 16:42
Joined: Apr 2008
Posts: 335
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 335
Austria
No, the long trade is opened. Hedge 0 only means that the short trades are then closed.

Re: Zorro vs Oanda: Lot sizes do not match [Re: MMK] #482272
01/22/21 09:35
01/22/21 09:35
Joined: Nov 2020
Posts: 5
M
MMK Offline OP
Newbie
MMK  Offline OP
Newbie
M

Joined: Nov 2020
Posts: 5
You are right of course:


http://manual.zorro-trader.com/hedging.htm:
"0 = no hedging; automatically close all opposite positions with the same asset when a new position is opened."


But it looks like Zorro has not closed all opposite position but closed one position partially without updating the lot sizes internally.
Oanda lot sizes are in line with the trading activities, Zorro lot sizes are not. This affects 2 trades (181 and 186) where a trade in the opposite direction ha been triggered.
I have attached two screenhots to illustrate this.

As error 075 has been reported, something must be wrong, but I do not see what that could be.

Attached Files
Trades Oanda.png (9 downloads)
Trades Zorro.png (8 downloads)

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