You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Can you make short sell orders manually through GUI? I suspect that short-selling may be disabled for that symbol.
Please check the symbol specifications dialog:
I am not using fancy symbols. For the test I used EURUSD. All types of orders are allowed for that.
You can calculate the margin required using a custom function:
To calculate margin for the affected symbol:
You can calculate the margin required using a custom function:
To calculate margin for the affected symbol:
Thanks man. But i'd prefer to negotiate the bugfix than to workaround core components. Functions affected by this bug are cascading and ruining a lot of things including test results calculations, balance calculations, etc etc.
This bug reappeared in the latest update I got (MT5, version 5.00 build 4270, 5 Apr 2024). I get reqMargin=0.
the output, before and after calling OrderCalcMargin, is (ordType is a ENUM_ORDER_TYPE variable):
ordType = 1, g_symbolName = GBPUSD, short_lot = 6.63, atprice = 1.24438, reqMargin = 0.0
ordType = 1, g_symbolName = GBPUSD, short_lot = 6.63, atprice = 1.24438, reqMargin = 0.0
and the boolean marginCheck is true.
Unfortunately, I am getting again the reqMargin=0 when calling OrderCalcMargin(). The current version I am running is MetaTrader5 version 4462 from July 29, 2024.
this is the call:
double reqMargin; PRINTVAR4(g_symbolName,short_lot,atprice,reqMargin); bool marginCheck=OrderCalcMargin(ORDER_TYPE_SELL,g_symbolName,short_lot,atprice,reqMargin); PRINTVAR2(marginCheck,reqMargin);
this is the output of each PRINTVAR:
2024.07.31 09:04:18.693 2023.07.28 02:30:00 : g_symbolName = USDJPY, short_lot = 21.0, atprice = 139.137, reqMargin = 2.6553274137e-314
2024.07.31 09:04:18.693 2023.07.28 02:30:00 : marginCheck = true, reqMargin = 0.0
It seems to be a lingering bug that is present in some versions of MT5...
any help?
thank you
Unfortunately, I am getting again the reqMargin=0 when calling OrderCalcMargin(). The current version I am running is MetaTrader5 version 4462 from July 29, 2024.
this is the call:
this is the output of each PRINTVAR:
2024.07.31 09:04:18.693 2023.07.28 02:30:00 : g_symbolName = USDJPY, short_lot = 21.0, atprice = 139.137, reqMargin = 2.6553274137e-314
2024.07.31 09:04:18.693 2023.07.28 02:30:00 : marginCheck = true, reqMargin = 0.0
It seems to be a lingering bug that is present in some versions of MT5...
any help?
thank you
Strategy Tester issue or on a live chart ?
coming back again to this issue that has not been resolved, it seems. It is in the Strategy Tester. Can you elevate this issue to be fixed soon?
thank you
coming back again to this issue that has not been resolved, it seems. It is in the Strategy Tester. Can you elevate this issue to be fixed soon?
thank you
As people don't answer questions, the issue is not even clearly identified (reproduced), so don't hope a fix.
Can you provide ALL details, including some code to reproduce it ?