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

MQL4 Experts Scripts

Tâche terminée

Temps d'exécution 3 jours
Commentaires de l'employé
Excellent client. Was helpful with testing and not afraid to ask questions.

Spécifications

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.


Répondu

1
Développeur 1
Évaluation
(19)
Projets
35
26%
Arbitrage
10
30% / 70%
En retard
5
14%
Gratuit
2
Développeur 2
Évaluation
(390)
Projets
416
30%
Arbitrage
74
19% / 72%
En retard
52
13%
Travail
3
Développeur 3
Évaluation
(50)
Projets
74
27%
Arbitrage
12
58% / 17%
En retard
14
19%
Gratuit
4
Développeur 4
Évaluation
(130)
Projets
184
32%
Arbitrage
18
28% / 67%
En retard
27
15%
Gratuit
Publié : 1 code
5
Développeur 5
Évaluation
(88)
Projets
143
39%
Arbitrage
21
19% / 48%
En retard
30
21%
Gratuit
6
Développeur 6
Évaluation
(36)
Projets
50
28%
Arbitrage
2
0% / 100%
En retard
6
12%
Gratuit
7
Développeur 7
Évaluation
(27)
Projets
43
7%
Arbitrage
18
6% / 78%
En retard
26
60%
Gratuit
8
Développeur 8
Évaluation
(84)
Projets
149
31%
Arbitrage
32
34% / 41%
En retard
43
29%
Gratuit
9
Développeur 9
Évaluation
(4)
Projets
4
25%
Arbitrage
1
0% / 0%
En retard
0
Gratuit
Publié : 3 codes
10
Développeur 10
Évaluation
(64)
Projets
144
46%
Arbitrage
19
42% / 16%
En retard
32
22%
Travail
Commandes similaires
Trading Bot 50+ USD
hello great developer I want to develop a trading bot which connects with my Binance account. A bot that can work with tradingview.com where I use trading indicator which is called " TonyUX Ema scalper ". This indicator generates Buy and Sell signal. So i want a bot which can execute trade on binance when it gets a Buy/sell signal on tradingview.com ( see attached picture) Most likely you already have a similar bot
I need an MT5 Expert Advisor based on SMC (Smart Money Concepts) and SCOB pattern. Entry logic (M1 first, must work all TF): 1. Detect OB or FVG. 2. When price touches OB/FVG, wait for SCOB candle confirmation. 3. Enter at close of SCOB. Stop Loss: - SL at the high/low of SCOB candle. Take Profit (Box TP rule): - Use distance between point 1 and point 2 as a box. - TP = 2 × box size. - Same method as drawing box and
Algo Trading Rebot/ EA 30 - 100 USD
I would like someone Who can design an EA for me. I will give him the Required Details and Trading Plan How it should Work. its going to be a Simple EA System Around Moving Averages Crossover. I will Provide Him the Moving Averages Settings and How It should execute trades and Exit them
Hello. I already have a fully working TradingView indicator written in Pine Script. I am NOT asking for a new strategy or indicator to be designed. I need an experienced NinjaTrader (NinjaScript / C#) developer to replicate the same logic and behavior of my existing TradingView indicator so it works on NinjaTrader. Important points: The TradingView indicator does NOT repaint (uses confirmed bars only). This is logic
No jokers copy pasters allowed. If you're proficient in MQL5, have a proven track record with EAs apply. Commissioning the development of a high-performance Expert Advisor (EA) engineered for the MetaTrader 5 (MT5) environment. The objective is to deploy an institutional-grade automated trading system capable of systematic market analysis, precision execution, and strict risk governance within the global forex
Create an ea that exit buy trades when red smiley face appear,exit sell trades when blue smiley face appear.in this case you need to better use the Smiley face signals which are 4 for BUY (blue smiley face)and 5 For SELL( red smiley face)
I’m looking to acquire an existing, profitable Expert Advisor (EA) with full source code to add to our client investment portfolio. To be clear, this is not a request to develop or design a new strategy. If you already have an EA that is proven, consistent, and production-ready, I’m open to reviewing it immediately. Please apply only if you meet all the requirements below. Submissions without a proper introduction or
Sniper 30+ USD
Hello, I would like you to develop a trading robot (EA) with the following specifications: The robot should be able to target large moves, ideally 60–100 pips or more per trade. It should use high-precision “sniper” entries, focusing on high-probability setups rather than frequent trades. Once the initial trade reaches breakeven, the robot should be able to add additional positions (scale in) while maintaining strict
True 30+ USD
Hello, I would like to commission the development of a trading robot (EA) designed specifically to pass a prop firm challenge within one week, with a maximum allowable drawdown of 2%. Key requirements: Strict risk management with drawdown hard-limits Controlled lot sizing and position management Strategy focused on high-probability, low-risk entries Full compliance with prop firm rules (daily drawdown, max drawdown
I want you to help me and create a sniper entry robot and with proper risk management that follow trend and when is not going to the direction it exit

Informations sur le projet

Budget
30 - 50 USD
Délais
de 2 à 3 jour(s)