Skipped trades Z1 Oanda

Posted By: AndersM

Skipped trades Z1 Oanda - 01/02/23 12:15

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
Posted By: jcl

Re: Skipped trades Z1 Oanda - 01/02/23 13:43

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.
Posted By: AndersM

Re: Skipped trades Z1 Oanda - 01/03/23 10:12

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
Posted By: jcl

Re: Skipped trades Z1 Oanda - 01/04/23 09:53

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.
Posted By: AndersM

Re: Skipped trades Z1 Oanda - 01/05/23 15:08


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.
Posted By: jcl

Re: Skipped trades Z1 Oanda - 01/05/23 16:55

Can you contact support with the problem and send them the generated Assets.csv file? They will find out what the problem was.
Posted By: AndersM

Re: Skipped trades Z1 Oanda - 01/06/23 10:44

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
Posted By: Spirit

Re: Skipped trades Z1 Oanda - 01/06/23 15:28

Which 2.53 was that? 2.53.6?
Posted By: AndersM

Re: Skipped trades Z1 Oanda - 01/07/23 13:27


It was 2.53, downloaded around start december.
Posted By: jcl

Re: Skipped trades Z1 Oanda - 01/09/23 08:17

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.
© 2024 lite-C Forums