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

MQL5 Komut dosyaları Entegrasyon

İş tamamlandı

Tamamlanma süresi: 1 gün
Müşteri tarafından geri bildirim
Great work, thanks.

İş Gereklilikleri

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. 

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(590)
Projeler
789
71%
Arabuluculuk
9
33% / 33%
Süresi dolmuş
22
3%
Ücretsiz
2
Geliştirici 2
Derecelendirme
(119)
Projeler
127
41%
Arabuluculuk
3
33% / 67%
Süresi dolmuş
0
Ücretsiz
3
Geliştirici 3
Derecelendirme
(97)
Projeler
121
25%
Arabuluculuk
5
20% / 60%
Süresi dolmuş
17
14%
Ücretsiz
4
Geliştirici 4
Derecelendirme
(133)
Projeler
185
30%
Arabuluculuk
77
9% / 73%
Süresi dolmuş
77
42%
Ücretsiz
5
Geliştirici 5
Derecelendirme
(39)
Projeler
81
38%
Arabuluculuk
1
0% / 0%
Süresi dolmuş
31
38%
Ücretsiz
Benzer siparişler
Moath jamal 30+ USD
//+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ int OnInit() { return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Script deinit function |
Hello please I need a developer to help me fix errors on my Ninjatrader 8 strategy I and make it work perfectly your expertise is need for this project kindly reach out to me and let's proceed
Hello, can you help me convert MT4 EA source code to MT5? I have two versions of an EA for MT4 that I have been using for quite a while and I want to move over to MT5. There are no additional indicators. Everything is inside the EA mq4. Also, could you provide a strategy guide in PDF format for me of both strategies, apply if you are professional enough in the field
"I'm seeking a skilled coder to assist in developing my custom Ninjatrader 8 strategy, ensuring flawless functionality without errors. Your expertise is essential for this project. Please contact me to discuss further details and proceed."
HI I HAVE A SENTIMENT DATA LIBRARY THAT I PURCHASED FROM SENTI FX FOR RETAIL SENTIMENT. WHAT IM LOOKING TO DO IS MAKE A BASIC INDICATOR IT HAS RETAIL POSTIONS LONG SHORT PERCENTAGE AND A RELATIVE SENTIMENT DATA. THAT WILL ALERT ME TO MY EMAIL
I am looking for a coder to code my custom Ninjatrader 8 strategy to make it work perfectly your professioalism is needed in the project Kindly cotact me now and let Proceed
I am looking for a coder to help me code my custom Ninjatrader 8 strategy and make it work perfectly without any error, your expertise is highly needed in this job kindly reach out to me and let proceed
I am looking for a developer to code my custom Ninjatrader 8 strategy and make it work perfectly, your expertise is highly needed for this project kindly reach out and let's proceed
Hello I am looking for a professional in building a stock trading robot and make it work perfectly Specifically, I want to build a robot for trading in options from the IOF your expertise is highly needed in this project Kindly reach out and let proceed
Need a tradin g robot 30 - 50 USD
I would like to create a robot (another version of a robot I already have) I currently have the source code but would like to have another robot that belongs to me but with different settings, if I provide you with the source code with all the settings are you able to remake me another robot with modifications? and if so what would be your price

Proje bilgisi

Bütçe
15 - 20 USD
Geliştirici için
13.5 - 18 USD
Son teslim tarihi
from 1 to 3 gün