Has anyone come across an issue with the LotAmount when trading Index CFDs with Oanda?

Correct me if I am wrong on this as I have been banging my head against the wall for the past couple days trying to figure this out.

There is an issue with how LotAmount and Lots are treated when in Trade mode for Index CFDs with Oanda. There is no issue when trading currencies. The requested AssetList provided by Oanda is correct with all their Index CFDs having LotAmount = 0.1. See included AssetList. The PIPCost reflects CAD currency as I am in Canada.

In Train and Test modes, all the relevant calculated positions sizes and performance values are correct. The problem comes about in Trade mode. Zorro executes the number of Lots, which to Zorro, represents (Lots * LotAmount) number of contracts in position size. So a 5 Lots execution represents 0.5 Index contracts, 5 Lots * 0.1 LotAmount. But to Oanda, the number of Zorro Lots being transacted, 5 in this example, represents (5 / 0.1) = 50 contracts of 0.1 LotAmounts, which is 10 times more than what is intended.

As you can see from a current NAS100 position in the table below pulled from the Zorro HTML Trading Status page, the Risk calculation of -$237 does not make sense for 27 Lots of 0.1 LotAmounts with a Stop distance from Entry to Stop of (16187 – 16257) = -70 PIPS. Using the PIPCost from the AssetList above, the Risk calculation should be -$2,339 ((27/0.1) * 70 * 0.123762), as to Oanda, the 27 Lots is 270 contracts of 0.1 LotAmounts. The Profit calculation of $3,861 in the table makes sense. There is also the CN50 position of 4 Lots listed.


Trade ID Lots Entry Time Entry Price Stop Trail Target Risk Profit Pips
[NAS100/USD:Trend:S00035] 35 27 11/10/2021 01:00 16187 16070 16257 15914 14985 -237$ 3861$ 1149.6p
[CN50/USD:Trend:L00047] 47 4 11/10/2021 08:00 15398 15580 14860 15780 16124 -267$ 922$ 1862.3p



I looked at changing the PIPCost by using SET_PATCH to accommodate the issue but realized that by making this adjustment, there would be unintended consequences of how Zorro calculates position sizes as I use the Risk trade parameter. I could also calculate the adjusted Lot amounts within the script to be sent to Oanda for execution but that defeats the whole purpose of Zorro’s functionality.

Oanda made changes to their Index CFD sizing earlier this year reducing the minimum trade size (LotAmount) from 1 to 0.1, which may not have been adjusted in the Oanda API. This, therefore, could be a bug with the API.

Has anyone experienced this?

I am using Zorro version 2.40.9.

Thanks, Jay

Attached Files
AssetsInd.csv (131 downloads)