Spin
Well-known member
- Joined
- May 22, 2019
- Posts
- 510
- Likes
- 216
I have been using the optimizer intensively lately and I noticed some quirks. I switched over to 'replay mode' to inspect more closely and discovered this:
In the Stategy's menu > trading options I set the parameters to 20k, so 20000 (because that is the 'standard' amount I want to use for a trade on the EUR/USD):

I also tell the Strategy to close the trade, using the same amount when TP is reached.
I then start replay and let it run until the first trade is closed. It opens with the correct value:

But on the TP-side I see this:

Upon re-verification of the TP-entries for my strategy, I see that the 20000 for exit was changed to 9999:

I guess numbers above 9999 (for Lots) cannot be used when using "qty = ep.getLots() * instr.getDefaultQuantity();" in Strategy-code.
Unfortunately, my broker needs these values in that way (changing the 20000 to 20 renders all calculations in Replay mode & the optimizer useless: all numbers for profit / loss are rounded down to 0.00 because they are too small)
(obviously, I can multiply the results with a factor after MW has finished its calculations, but that seems too cumbersome, given the power of the platform)
This is rather annoying. Does anyone know of a 'hack' to remediate this ? Changing the standard instrument's values perhaps ?
And while we are at it: any suggestions on how to 'fake' leverage when using Replay Mode or the Optimizer ??
Very often FX-accounts allow for some sort of leverage, and I would like to incorporate this in my backtesting / optimizing, to approach reality even closer.

In the Stategy's menu > trading options I set the parameters to 20k, so 20000 (because that is the 'standard' amount I want to use for a trade on the EUR/USD):

I also tell the Strategy to close the trade, using the same amount when TP is reached.
I then start replay and let it run until the first trade is closed. It opens with the correct value:

But on the TP-side I see this:

Upon re-verification of the TP-entries for my strategy, I see that the 20000 for exit was changed to 9999:

I guess numbers above 9999 (for Lots) cannot be used when using "qty = ep.getLots() * instr.getDefaultQuantity();" in Strategy-code.
Unfortunately, my broker needs these values in that way (changing the 20000 to 20 renders all calculations in Replay mode & the optimizer useless: all numbers for profit / loss are rounded down to 0.00 because they are too small)
(obviously, I can multiply the results with a factor after MW has finished its calculations, but that seems too cumbersome, given the power of the platform)
This is rather annoying. Does anyone know of a 'hack' to remediate this ? Changing the standard instrument's values perhaps ?
And while we are at it: any suggestions on how to 'fake' leverage when using Replay Mode or the Optimizer ??
Very often FX-accounts allow for some sort of leverage, and I would like to incorporate this in my backtesting / optimizing, to approach reality even closer.

Last edited: