Code a function that returns the correct lot size basing on two inputs: stop loss and balance to risk

작업 종료됨

실행 시간 11 일
고객의 피드백
_Techno_ did a great job that no one else on the Forums was able to do. He is a real pro and the code delivered works perfectly and with any broker and is easy to read and as optimized as it can get. Communication was always prompt and on time and very professional and friendly as well. I can highly recommend him!

명시

Hello Coders,

I am looking for a function (not a complete EA, but a function that I can use from any of my EA´s that I code) that I simply can call like:


Lotsize = ExampleLotFunction(BalanceToRiskInPercent, StopLossPrice);

so for example with values:

Lotsize = ExampleLotFunction(2, 1.23456);


... and it returns the correct lot-size to risk exactly 2% of my current Account balance in my base-currency with the StopLoss passed to it and taking into account the account-base-currency and ANY conversions needed of course if the pair I trade is not in the account-base-currency (example: trading the AUDNZD on a account with the base currency EUR). I have found code on the forum that does work correctly if my account-base-currency is included in the pair that I trade (example: EUR is the account-base-currency and I trade EURUSD), but none yet that calculates correctly if trading AUDNZD, GBPCAD, NZDJPY or whatever and my account-base-currency is in EUR. Hence this request here in the hope someone can finally code something like this for me:)

The code should be of good quality and just be in a simple complete function so that I can use it for any of the EA´s I will be coding in the future without creating a mess and just should take those 2 input variables: Percent of current account balance to risk for the current trade by taking into account the stop loss I´ve passed to it.

Of course it should also be highly adaptive and should have no hard-coded constraints, meaning that it should adapt to different account-base-currencies, 4 and 5 digit brokers, check for the correct lot-step, lot-min and lot-max, etc. etc. Just what a professional function requires.

Thank you:)


P.S.: IMPORTANT: THS IS FOR MT4, not MT5 !


응답함

1
개발자 1
등급
(473)
프로젝트
1138
44%
중재
51
31% / 33%
기한 초과
500
44%
무료
2
개발자 2
등급
(187)
프로젝트
367
56%
중재
45
22% / 56%
기한 초과
188
51%
무료
3
개발자 3
등급
(24)
프로젝트
98
83%
중재
4
0% / 25%
기한 초과
9
9%
무료
비슷한 주문
NADGIO 30+ USD
I need a developer that can convert two Buy and Sell indicators into a trading robot. the indicators has an input parameter, this should be made available for adjustment. Features 1. Break Even 2. Trailing Stop 3. Global TP and SL 5. Time Filter 6. News Filter (If possible)
I need a developer who can convert trading view indicator in to mt5 expert advisor with some modifications. The other details will shared once chosen the developer. Looking for someone who has good knowledge of forex, mql5,and pine script
Hello, i hope you all well. I am looking or a good developer who can understand SCM/ICT concepts so that can modify an existing EA to trade against that. The EA is already there with code and it was trading based on Breakouts zones. Now i want the EA to be modified so that it trades based on inducements and liquidity. The EA should use Pending orders on those zones instead. I do not want new developers to apply
EA for index trading using ATR % of 5day 1 Give Average true range for the past 5 day so 5day ATR also for ref use the indicator "atr value indicator " my entries will be based on a % of this NO. NO. TO BE SHOWN IN TOP CORNER The Expert im looking for is 1.AT X TIME (ie 8:am ) 2.IF price moves X % of the 5 day atr( either up or down ) within Y TIME (IE 5MINUTES ) (if PRICE moves say 30% of the 5 day atr down i buy or
I want to create an Expert Advisor (EA) that can be set to open either buy or sell trades, depending on user preference (buy-only or sell-only mode). The EA will initiate trades when the market reaches (or is equal to or less than) a specified DeMarker value (e.g., DeMarker value = 0.3). The user will set both the DeMarker value for starting trades and another DeMarker value to stop opening new trades. - **DeMarker
Create a mql5 expert advisor for forex/commodities trading based on modified candlestick formation. If modified bullish engulfing appears, EA will open buy position at closing of last candle area with martingale until opening of last candle area and set stop loss at open last candle area. Trailing stop appears when half of all buy positions running profit then when all buy positions running profit, and so on. If
I want to grid based robot such like CM Manual Grid for mt 5 Snap of that attached. like The expert Advisor helps set a network of pending orders and collect profit from any price movement. I can use it to trade many grid strategies. I can also use it to track open positions. "Buy Stop — - open a network of pending stop orders for sale "Sell Stop" - open a network of pending stop orders for purchase "Buy Limit" -
I have developed a very strong TradingView strategy in Pine Script but unfortunately, a third-party connector is requiired and in my opinion, I want a more direct connection. I am not brilliant at coding, but I have coded the majority of the MT5 code and I would like you to make sure that the MT5 code matches my TradingView script and executes the same way as the TradingView script
Hi, I would like to have an EA to open trade when 2 time frame met the condition. Need to have ability to select the TF combination, Example: H4 with H1, H1 with M15 etc. PS: Able to lock EA with "Name" or "Account Number" PSS: Able to set trading session for specific pair. Example: US session = EURUSD For Buy #1 Big TF Candle Closed Outside Top BB #2 Big TF Candle touch low MA #3 Got to Smaller TF Candle touch &
I have thee best concept period, hence i got less to say. Actions speaks louder then words. Sign up and lets get started as there is a big world that awaits all your your adventures

프로젝트 정보

예산
10 - 30 USD
VAT (19%): 1.9 - 5.7 USD
총: 11.9 - 35.7 USD
개발자에게
9 - 27 USD