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

MQL5 스크립트 통합

작업 종료됨

실행 시간 1 일
고객의 피드백
Great work, thanks.

명시

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. 

응답함

1
개발자 1
등급
(590)
프로젝트
789
71%
중재
9
33% / 33%
기한 초과
22
3%
무료
2
개발자 2
등급
(119)
프로젝트
127
41%
중재
3
33% / 67%
기한 초과
0
무료
3
개발자 3
등급
(97)
프로젝트
121
25%
중재
5
20% / 60%
기한 초과
17
14%
무료
4
개발자 4
등급
(133)
프로젝트
185
30%
중재
77
9% / 73%
기한 초과
77
42%
무료
5
개발자 5
등급
(39)
프로젝트
81
38%
중재
1
0% / 0%
기한 초과
31
38%
무료
비슷한 주문
I need a professional who have the full knowledge in Ctrader and I want to add new idea for my ctrader https://ctrader.com/algos/indicators/show/3444/ Let me know if this is what you can do and the price to get it done. Thanks
Hi All i need programmer to make me 2 programs first program send sell or buy from tradingview to MT4 and MT5 not using alert on tradingview . not using WEBHOOK\ mean using trade order manually from tradingview to MT Second using alert webhook from indicators inside tradingview
I am looking for a skilled Thinkorswim script developer for a one-time project. Your task will be to combine 8 distinct Thinkorswim studies (I will provide the code for each) into one Lower Study. The final script should display histogram rows for the individual studies with a bubble color scheme of bright green, dark green, gray, dark red, and bright red
I need some who can develop my strategy and hand me over the source code... I will give you the specific area in the market i want to mark out and then set pending orders to execute once price move into the zone
C onversion from Ninjatrader to Tradingview. This includes thorough testing and debugging to guarantee that the script functions as intended on Tradingview...If you are in for this job kindly bid
I believe in Robotics as a major artificial intellect to function of growth of business.Therefore if you script there is a likelihood of bringing economies of scale.The retrospective of the dynamics of indulgence of work can be economics of scale
there I hope you're doing well I want to convert the tradingview indicator to make an indicator for mt5. And in that, I want to make an automatic robot on the base of the indicator. I have the pine script of that indicator
Looking for someone who is able to code MQL for MT5 manager plug-in? Please contact me for more info. it is mainly on when to trigger a stop out of the account

프로젝트 정보

예산
15 - 20 USD
개발자에게
13.5 - 18 USD
기한
에서 1  3 일