You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If your order opens, check for the opening of one order and if it opens, you may open the second order with a check...
I have written two functions that open differently depending on the situation and I will check at the end of each of them (I think they will be a separate function) what and how many orders are open and what orders will be missed and will be reopened.
If you are an expert in the field of positioning of the EA in terms of forex, you may be interested in finding out more about it and use it in your trading robot. I would like to reiterate my thanks (sorry for the lack of details).
Good morning.
A problem has arisen. I can't find the function that returns the size of the "aggregate" position of a given instrument! I searched the whole forum, including I.KIM's branch,https://www.mql5.com/ru/forum/131859 - there are - different functions for lots, except for the one I need!
For example, if there are several open "buy" deals on EUR, can you advise how to determine their total amount?
GetLot(EURUSD, OP_BUY, magic)
Question cleared! A function has been discovered:
How is it wrong? Then what does this function return?
"Returns the sum of lots of open positions " - isn't it written?
https://www.mql5.com/ru/code/9394
"Returns the sum of the lots of open positions" - isn't it written?
I don't need to take locs into account. Or rather, here's how:
What I need is this. If there are several open Sell and Buy positions, I need to remove the counter (compensating) positions, so - to remain only in one direction.
I wanted to first calculate the sum of all "bays", then the sum of all "sells". After that, find the difference (i.e. whose total size is greater). And this "difference" should be left in the market, - and all the opposite ones removed!
So, this function GetAmountLotFromOpenPos will not work here? For example, if I set
GetAmountLotFromOpenPos(EURUSD,OP_SELL, -1)
-Won't it return the total amount of lots of all the sell positions?
-won't she give me back the sum of the lots of all the sell positions?
I don't need to take locs into account. Or rather, here's how:
What I need is this. If there are several open Sell and Buy positions, I need to remove the counter (compensating) positions, so - to remain only in one direction.
I wanted to first calculate the sum of all "bays", then the sum of all "sells". After that, find the difference (i.e. whose total size is greater). And this "difference" should be left in the market, - and all the opposite ones removed!
So, this function GetAmountLotFromOpenPos will not work here? For example, if I set
GetAmountLotFromOpenPos(EURUSD,OP_SELL, -1)
-Won't it return the total amount of lots of all Sell positions?
In the general case:
SummLot = GetAmountLotFromOpenPos("0", OP_BUY, MagicNumber)- GetAmountLotFromOpenPos("0", OP_SELL, MagicNumber);