Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 863 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Skipped trades Z1 Oanda #487032
01/02/23 12:15
01/02/23 12:15
Joined: Dec 2022
Posts: 5
Gredstedbro
A
AndersM Offline OP
Newbie
AndersM  Offline OP
Newbie
A

Joined: Dec 2022
Posts: 5
Gredstedbro
Hi,

Happy new year to all :-)

I'm running the Z1 system, on an Oanda paper account, in preparation to go live with real money. It all runs smooth apart from one thing. I get several "skipped trades" and can't figure out what I do wrong.

Below is one example with XAU. During the last two months, I had the same issue with NAS100, US30, US500, GER30.

[Mon 22-12-19 00:21] 3980 -19.96 0/3 (1.21661)
(XAU/USD:HU:L) Skipped (Margin 105 Min 358)

As i understand the documentation, this means that zorro skipped the trade, because the margin requirements for one lot is 358, and zorro wants to buy 105 margin only.

But if i open my account at Oanda, I see margin requirements of 91 for one lot XAU, and not the 358 reported by zorro. With the current price around 1820, zorro assumes margin of 20%(358/1820) while the account has margin of 5%(91/1820).

This margin requirements should come from the broker API if available, or from parameters in the asset csv file.
XAU has the following parameters in the assetFix.csv:
Multiplier = 1
MarginCost = -1

With correct multiplier and 1% margin in asset csv file, I don't understand where Zorro gets the 20% margin requirements from?

Hopefully you can help me sort it out, thanks a lot...

regards
Anders

Re: Skipped trades Z1 Oanda [Re: AndersM] #487033
01/02/23 13:43
01/02/23 13:43
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
In live trading, Zorro retrieves margin, lot amount etc. not from the asset list, but from the broker API. It stores them in Assets.csv in the Log folder. In that file you can see the actual parameters of your Oanda account, and can thus verify if the minimum margin is correct.

Re: Skipped trades Z1 Oanda [Re: AndersM] #487037
01/03/23 10:12
01/03/23 10:12
Joined: Dec 2022
Posts: 5
Gredstedbro
A
AndersM Offline OP
Newbie
AndersM  Offline OP
Newbie
A

Joined: Dec 2022
Posts: 5
Gredstedbro
Hi JCL,

Thanks a lot for your reply, that brought me closer to a solution, but still….

The Log/Assts.csv file has some weird margins. I tried to delete it, and restart Zorro, to see if it had somehow received wrong margins from Oanda. Same result.

Gold and equity indexes, all at 20% margin, which explains the skipped trades.

FX margin examples - AUDUSD 20%, EURCHF 1%, EURUSD and USDJPY 30%. That explains why also FX positions seems relatively small compared to testing. But something is clearly wrong with these FX margins.

A backtest with the Oanda “API margins” results in 9% annual return vs 51% with the margins, that I see when logged in to the Oanda platform(4-5%).

Then my question is. Have you seen this type of discrepancy before, the difference between API and trading platform margins? The weird high and very different FX margins?

I guess the problem lies with Oanda, but still you might have some experience with the same issues. Should I expect different API margins on a real account vs paper account?

Thanks

Regards
Anders

Re: Skipped trades Z1 Oanda [Re: AndersM] #487041
01/04/23 09:53
01/04/23 09:53
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
With Forex, paper and real accounts have often very different margins. Real account margins depend on your country and account type, paper account margins don't. The Oanda plugin reads the margin from the "marginRate" parameter of the Oanda API, so I assume that's the real margins of your account.

Re: Skipped trades Z1 Oanda [Re: AndersM] #487051
01/05/23 15:08
01/05/23 15:08
Joined: Dec 2022
Posts: 5
Gredstedbro
A
AndersM Offline OP
Newbie
AndersM  Offline OP
Newbie
A

Joined: Dec 2022
Posts: 5
Gredstedbro

Thanks for you reply. I tried to investigate a little further...

I made a small Python script connecting to Oanda API and retrieving the marginRates for all Assets. Python retrieved marginRates are correct, exactly the same as on the trading platform. Zorro marginRates are not correct, they are higher by a factor 4-10. Python is connecting to the same account, from the same cloud machine as zorro is currently running on, but getting different marginRates.

I don't understand what going on here.

Re: Skipped trades Z1 Oanda [Re: AndersM] #487054
01/05/23 16:55
01/05/23 16:55
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Can you contact support with the problem and send them the generated Assets.csv file? They will find out what the problem was.

Re: Skipped trades Z1 Oanda [Re: AndersM] #487056
01/06/23 10:44
01/06/23 10:44
Joined: Dec 2022
Posts: 5
Gredstedbro
A
AndersM Offline OP
Newbie
AndersM  Offline OP
Newbie
A

Joined: Dec 2022
Posts: 5
Gredstedbro
Hi,

Problem is solved…

I have rolled Zorro back from version 2.53 to version 2.50, and now it reports correct marginRates, and position sizes should start to make sense.

Let me know if you are insterested in any files to investigate possible issues with 2.53...

regards
Anders

Re: Skipped trades Z1 Oanda [Re: AndersM] #487059
01/06/23 15:28
01/06/23 15:28
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Which 2.53 was that? 2.53.6?

Re: Skipped trades Z1 Oanda [Re: AndersM] #487061
01/07/23 13:27
01/07/23 13:27
Joined: Dec 2022
Posts: 5
Gredstedbro
A
AndersM Offline OP
Newbie
AndersM  Offline OP
Newbie
A

Joined: Dec 2022
Posts: 5
Gredstedbro

It was 2.53, downloaded around start december.

Re: Skipped trades Z1 Oanda [Re: AndersM] #487070
01/09/23 08:17
01/09/23 08:17
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I think the problem has been found. I could not reproduce a wrong margin here, but learned from the developers that there was indeed a margin bug in 2.53. It is supposedly fixed in the latest version 2.53.7.

Since you found a bug in a release candicate, you're entitled to a free Zorro S subscription or extended support period - please contact Support for claiming the prize.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1