Library/class for calculating Required Margin.

Job finished

Execution time 29 days
Feedback from employee
Positive experience with a great client, developer himself. Calm and attentive to details, appreciative of and willing to accommodate unexpected job complexity.
Feedback from customer
great developer, has extensive programming knowledge, strongly committed, effective in solving encountered problems in the project.

Specification

I need to write a library to calculate Required Margin in MT4 and MT5 according to the following requirements:

Create a ReqMargin class and add a public function in it

double ReqMarginCalc(string symbol, double lot)

which calculates and returns the required margin for the given symbol and lot.
The function must work for both MT4 and MT5.
It is best to have one common mqh file with the class and divide the code inside with directives:

#ifdef __MQL5__
// MQL5 code
#else
// MQL4 code
#endif

The function must correctly calculate Required Margin for all types of instruments available in metatrader, not only currency pairs but indices, commodities, cryptos, etc.

All source code must be provided.

Responded

1
Developer 1
Rating
(296)
Projects
368
30%
Arbitration
37
27% / 65%
Overdue
10
3%
Working
Published: 10 codes
2
Developer 2
Rating
(195)
Projects
242
34%
Arbitration
11
45% / 45%
Overdue
8
3%
Free
Published: 1 article, 8 codes
3
Developer 3
Rating
(19)
Projects
27
26%
Arbitration
2
0% / 100%
Overdue
2
7%
Free
4
Developer 4
Rating
(16)
Projects
35
23%
Arbitration
4
0% / 50%
Overdue
2
6%
Working
5
Developer 5
Rating
(45)
Projects
46
24%
Arbitration
34
9% / 85%
Overdue
10
22%
Free
6
Developer 6
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Published: 9 codes
7
Developer 7
Rating
(32)
Projects
42
43%
Arbitration
2
100% / 0%
Overdue
4
10%
Free
8
Developer 8
Rating
(1)
Projects
2
0%
Arbitration
2
50% / 50%
Overdue
0
Free
Similar orders
I am looking for the original developer from Egypt who sent me the MJ v3.01 Gold EA (mj.ex5) on December 2, 2026, with a 10-day demo trial. You were Developer #28 in my previous Freelance job and offered the EA for $200. Unfortunately, I lost access to our previous conversation and would like to reconnect with you. I am still interested in your EA and would like to complete the testing, discuss the settings, and
I am looking for one existing MT5 trading strategy with documented net profit after trading costs. I am open to different instruments and timeframes. I want to run the strategy in my own MT5 Strategy Tester using the same fixed settings. To apply, briefly describe how the strategy trades, name the instrument and timeframe, and share one link or report showing its results. Please say whether it is a verified live
Gulu 30+ USD
create money on forex ensuring nothing but profit basically also crypto an d ensure you use every means possible to ensure in turn a profit is made that what i want i want perfection
I am looking to purchase an existing, fully developed and operational XAUUSD scalping Expert Advisor (EA) for MetaTrader 5. IMPORTANT: I am NOT looking for new development, custom programming, or an experimental strategy. I am only interested in an existing, ready-made and proven trading system. Requirements: Fully automated XAUUSD scalping EA for MT5. Short-duration trades with an active trading frequency. Hard Stop
The idea of the trading system is as follows : market entries are performed when MACD's main and signal lines intersect in the current trend direction . 2. Trend is determined based on the Exponential Moving Average with the specified period (InpMATrendPeriod). If the current EMA value is greater than the previous one, the trend is seen as growing (ema_current > ema_previous). Alternatively, if current EMA is
Looking to Purchase a Proven and Profitable XAUUSD Scalping EA for MT4 I am looking to purchase an existing, fully automated Gold (XAUUSD) scalping EA specifically designed for MetaTrader 4 (MT4) , with proven and verifiable real-money trading performance. Mandatory Requirements: Exclusively designed for XAUUSD (Gold). Fully automated trading on MetaTrader 4. Genuine scalping strategy with relatively short trade
OVERVIEW I have three MT4 custom indicators in .ex4 format only. I do NOT have the .mq4 source files. I need working MT5 versions of all three, with full .mq5 source code. The MT5 versions may be: (a) rebuilt from scratch in MQL5 by analyzing how the EX4 indicators behave, or (b) obtained from the original author's official MT5 version, if one legitimately exists. Decompiling the EX4 files is NOT acceptable. THE
I am looking for an experienced quantitative researcher to conduct empirical and statistical research on systematic trading strategies, with an initial focus on XAUUSD. The research will cover three main areas: Market structure Market behaviour Quantitative strategy validation, backtesting and robustness analysis. I already have a functional MT5 EA that I would like to improve through extensive quantitative research
--- I need an MT5 Expert Advisor (EA) for Forex trading. Strategy: - Trade when fast Moving Average (9) crosses above slow Moving Average (21) = BUY - Trade when fast Moving Average (9) crosses below slow Moving Average (21) = SELL - Only 1 trade at a time Settings I want to change: - Lot size - Stop Loss in pips - Take Profit in pips - Trailing Stop - Trading hours (Start and End time) Risk: - Close all trades at
Hello, I'm looking for a developer who can build an automated trading bot (Expert Advisor) for MetaTrader 5 (MT5). I want a smart trading robot that can scan the markets, identify high-probability trading opportunities, and automatically execute trades. Strategies and indicators I'd like included: RSI (75 overbought / 25 oversold). MACD crossover with strong momentum. 9/21 EMA crossover. 20/50 SMA crossover. Smart

Project information

Budget
30+ USD
Deadline
to 3 day(s)