Can you convert this script to an indicator? An indicator will be convenient than a script.
Thank you , It is something I found helpful . Possibly and issue with the JPY combinations? . Would be nice to capture the swap also
Wrong formula
Kudakwashe Mafutah #:
please share appropriate formula and will be happy to update. both indicator and script
Formula for script and Expert Advisor:
string symbolName = SymbolName(i, false); // Get the minimum margin for the symbol double minLotSize = SymbolInfoDouble(symbolName, SYMBOL_VOLUME_MIN); double price = SymbolInfoDouble(symbolName, SYMBOL_ASK); double margin = -1; bool res = OrderCalcMargin(ORDER_TYPE_BUY, symbolName, minLotSize, price, margin);
For indicators:
Becuase the OrderCalcMargin() function is prohibited in indicators, So you can use this OrderCalcMarginCustom() function, in the attachment.
double margin = -1; bool res = OrderCalcMarginCustom(ORDER_TYPE_BUY, symbolName, minLotSize, price, margin);
Files:
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
Get min margin in to csv:
The script MinMargins.mq5 is designed to help traders quickly calculate and document the minimum amount of money required to open a position with the smallest lot size for all symbols available in the Market Watch. This data is saved to a CSV file for easy review and analysis.
Author: Kudakwashe Mafutah