Write a function to calculate maximum lot size for the given percentage margin of risk

MQL5 Skripte Integration

Auftrag beendet

Ausführungszeit 1 Tag
Bewertung des Kunden
Great work, thanks.

Spezifikation

I need the following function to complete:

double GetMaxLotSize(int cmd, double sl, double risk_margin = 1.0, string symbol = NULL)

Arguments are:

- cmd: Command such as OP_BUY or OP_SELL.

- sl: Stop loss to calculate the lot size for.

- risk_margin: Account margin to risk (in %), e.g. Money = AccountBalance() / 100 * risk_margin (e.g. 1.0%)

-  symbol: If NULL, means current.

The output:

- Maximum safe lot size value to use where given SL won't exceed the percentage of risk margin amount.

This should work similar as GetMaxStopLoss() which calculates the maximum SL for given lot size, but GetMaxLotSize should work other way round.

The code should be compatible with MQL4 and MQL5. 

Bewerbungen

1
Entwickler 1
Bewertung
(590)
Projekte
789
71%
Schlichtung
9
33% / 33%
Frist nicht eingehalten
22
3%
Frei
2
Entwickler 2
Bewertung
(119)
Projekte
127
41%
Schlichtung
3
33% / 67%
Frist nicht eingehalten
0
Frei
3
Entwickler 3
Bewertung
(97)
Projekte
121
25%
Schlichtung
5
20% / 60%
Frist nicht eingehalten
17
14%
Frei
4
Entwickler 4
Bewertung
(133)
Projekte
185
30%
Schlichtung
77
9% / 73%
Frist nicht eingehalten
77
42%
Frei
5
Entwickler 5
Bewertung
(39)
Projekte
81
38%
Schlichtung
1
0% / 0%
Frist nicht eingehalten
31
38%
Frei
Ähnliche Aufträge
I am seeking a coder who has experience in converting an MT4 indicator & EA(.mq4 file, source code provided) to TradingView's Pine Script. The indicator should be identical to the original, with the same inputs and settings. Upon completion of the task, the coder will send me the Pine Script indicator & EA along with the full source code, and the project will remain confidential. This task should be straightforward

Projektdetails

Budget
15 - 20 USD
Für die Entwickler
13.5 - 18 USD
Ausführungsfristen
von 1 bis 3 Tag(e)