Code to count lot size of the same currency across orders on both buy and sell

MQL4 专家 脚本

工作已完成

执行时间3 天
员工反馈
Excellent client. Was helpful with testing and not afraid to ask questions.

指定

I need a developer with very good English skills to provide me the code for a function that I want to insert into my own code and which should do the following:

-          Count how many open orders a currency (or an index, etc) is involved in, separately on buy and sell.

-          Count the total lot size on buy and the total lot size on sell that the currency (or index) is involved in.


For example, if I have the following trades open:

2 lots of SELL GBPUSD

0.5 lot of SELL EURGBP

0.5 lot of BUY EURUSD

 

Then the results provided by the function will be:

Total number of open orders BUY on GBP: 1

Total lot size BUY on GBP: 0.5

Total number of open orders SELL on GBP: 1

Total lot size SELL on GBP: 2

Net lot size on GBP (BUY-SELL): -1.5


The function will return the same type of results for EUR, USD and all other currencies, indices, etc that are involved in open orders.

Important: you have to be careful to identify when the currency is the first or the second in the currency pair in order to get the result right. For example, a SELL order on EURGBP counts as a SELL on EUR, but as a BUY on GBP.

The code should also work for symbols composed of only one element, like US30.

Exception: I need an exception to be introduced in the case of instruments XTIUSD and XAUUSD, in the sense that in these cases the function will NOT add these to the count of number of orders and size of lots on USD, BUT it will add them to the count of the number of orders and the size of lots on XTI and XAU respectively.

Use of the function:

I should be able to call this function in the main program something like this: get_lot_count(Symbol), where symbol can be GBPUSD, XTIUSD, US30, etc. When called, the function will calculate and provide (in separate variables) all the information mentioned above in relation to the instrument(s) present in the symbol, regardless of whether there are 2 currencies  in the Symbol (like in EURUSD, in which case the information will be, of course, separate for EUR and USD) or a stand-alone instrument in the symbol (like in US30).

I am flexible to suggestions on how to best organise the information.

Note: when applying for this job please let me know if you have experience in doing something similar or other information that would help me understand that you actually looked carefully at the specs and that you are not just sending an “automated” application.


反馈

1
开发者 1
等级
(19)
项目
35
26%
仲裁
10
30% / 70%
逾期
5
14%
空闲
2
开发者 2
等级
(390)
项目
416
30%
仲裁
74
19% / 72%
逾期
52
13%
工作中
3
开发者 3
等级
(50)
项目
74
27%
仲裁
12
58% / 17%
逾期
14
19%
空闲
4
开发者 4
等级
(130)
项目
184
32%
仲裁
18
28% / 67%
逾期
27
15%
空闲
发布者: 1 代码
5
开发者 5
等级
(88)
项目
143
39%
仲裁
21
19% / 48%
逾期
30
21%
空闲
6
开发者 6
等级
(36)
项目
50
28%
仲裁
2
0% / 100%
逾期
6
12%
空闲
7
开发者 7
等级
(27)
项目
43
7%
仲裁
18
6% / 78%
逾期
26
60%
空闲
8
开发者 8
等级
(84)
项目
149
31%
仲裁
32
34% / 41%
逾期
43
29%
空闲
9
开发者 9
等级
(4)
项目
4
25%
仲裁
1
0% / 0%
逾期
0
空闲
发布者: 3 代码
10
开发者 10
等级
(64)
项目
144
46%
仲裁
20
40% / 15%
逾期
32
22%
工作中
相似订单
Prakash 30 - 200 USD
i want to make trading bot for my xauusd trading. who can provide me code for good algo for auto trading? which logic is safe for trading?i want expert who can made code for me. thanks
Smc 30 - 200 USD
#property copyright "Amanda V" #property version "1.01" #property indicator_chart_window #property indicator_buffers 0 #property indicator_plots 0 input int InpSwingLookback = 30 ; // Swing Lookback Period input double InpMinWickPct = 30.0 ; // Min Rejection Wick % input color InpBullColor = clrAqua ; // Bullish Sweep Color input color InpBearColor =
Description: I need an MT5 Expert Advisor built to exactly replicate a TradingView Pine Script strategy. This is a range mean reversion system . All logic must be followed precisely. No optimisation, no interpretation. The EA must behave identically to the logic below. Market & Timeframe Primary: NAS100 (but must work on any symbol) Timeframe: 5-minute Must work regardless of broker (handle symbol digits properly)
I am looking for an experienced MQL5 developer to improve an existing forex EA, not build a completely new robot from zero. Important note: I use GPT to help me write because my English is limited. The wording may be assisted by GPT, but the trading issues, testing observations, and improvement goals are real from my side. I need a developer who is patient, understands strategy logic well, and can explain the
Fair Value Gap Expert , Optimize the core logic for live chart . [Filters are working] Lets ace the trailing stop . Change points to pip . Project will start from next week
I am looking to develop a highly optimized and fully modular script in MQL5 specifically for detecting RSI Divergences. This script will serve as a foundational building block to be integrated into a larger, comprehensive Expert Advisor (EA) later. Therefore, execution speed, strict logic, and a clean codebase are my absolute top priorities. Here are the core technical requirements for this project: 1. MQL5
My requirement i have mention in the video. I explain it from a screen record will be more clear https://www.youtube.com/watch?v=oTCWx7tfckM Mainly RSI martingale TP/SL lot size will auto base on the profit/loss i wish to risk
We have an existing Expert Advisor (EA) for MetaTrader 4. We need to restrict the EA so it only works on specific MetaTrader account ID(s). Key Requirements: Add account ID locking functionality to the EA. EA should run only on authorized account number(s). If used on any unauthorized account, the EA should: Stop trading, and/or Display an error message (e.g., “Unauthorized Account”). Ability to easily update or add
I hope to acquire a profitable and existing expert advisor (EA) from the gold market, with complete source code, to add to our client portfolio. you can WECHAT: Faca7898 Please note EA when adding friends. It should be clarified that this does not require you to formulate or design new strategies. If you already have a verified, consistent, and production-ready EA, I am willing to purchase it immediately and engage
Hello I want a very profitable scalping EA , tight stoploss and low drawdown , for Xauusd or any pair, time frame any, daily profit 20$ minimum and minimum deposite 200$ maximum sir

项目信息

预算
30 - 50 USD
截止日期
 2  3 天