[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 582
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
Kim's latest published function GetPotentialLossInCurrency (https://forum.mql4.com/ru/11287/page107) only takes into account open orders:
I tried to widen it a bit by including pending orders in it (by simply adding other types): but pending orders are not taken into account. Are they counted differently? The documentation doesn't say anything about this....Pending orders have no "total potential loss of open positions in the deposit currency".
The GetPotentialLossInCurrency() function returns the total potential loss of open positions in the deposit currency.
It refers to positions in the market. Press F1 on these market functions, re-read the information carefully:
Pending orders do not have "total potential loss of open positions in the currency of deposit".
The GetPotentialLossInCurrency() function returns the total potential loss of open positions in the deposit currency.
We are talking about positions in the market. Press F1 on these market functions, re-read the information carefully:
Question to programmers:
on a new bar, the Expert Advisor checks if the order on euro is alive (for example), if not - it makes a new deal, if yes - it leaves everything as it is.
put such a condition:
But the code does not work. Where is the error?
Here is a question for the programmers:
on a new bar, the EA checks if the EUR order is alive (for example, if it is not, it opens a new deal, if it is, it leaves everything as it is.
I have set such a condition:
But the code doesn't work. Where is the error?
Look what happens if there are a dozen orders and yours is the seventh (for example)
Check the first one - it is not ours.
Check the second one, it's not ours.
...
check the seventh - ours
check the eighth, it is not ours.
...
The idea is that when you open a bunch of orders on one pair, you can close all overlapping orders in one move.
Modify/delete order--->type---->Close overlapped orders
It deletes overlapped orders... Is there such a function in MQL?
Oops, found it:https://forum.mql4.com/ru/4822
see what happens if there are a dozen orders and yours is the seventh (for example)
check the first one - it is not ours.
Check the second one, it is not ours.
...
check the seventh - ours
check the eighth, it is not ours, set the order
...
There is only one order open on this pair. I only check for the given EURUSD symbol, but I must not have set the condition correctly
if(OrderSymbol()!="EURUSD"||Tip>1){continue;}else{
we need if(OrderSymbol()= Symbol("EURUSD"){
There is only one order open for this pair. I am checking only for the given EURUSD symbol, but I must have set the condition wrong
if(OrderSymbol()!="EURUSD"||Tip>1){continue;}else{
need if(OrderSymbol()= Symbol("EURUSD"){
if you have just 1 in your EA, you can just remember its ticket and check every time it is closed or not, without going through all the orders
Thank you very much for the recommendation, I almost figured it out, just do not remember if order is triggered, then ticket takes value -10?
Pending orders do not have "total potential loss of open positions in the currency of deposit".
The GetPotentialLossInCurrency() function returns the total potential loss of open positions in the deposit currency.
It refers to positions in the market. Press F1 on these market functions, re-read the information carefully:
I understand very well that the GetPotentialLossInCurrency() function is talking about open positions. I have a question: why can't pending orders be accounted for as well?
The documentation:
Nowhere does it say that OrderOpenPrice and/or OrderStopLoss only apply to open orders.
Thank you very much for the recommendation, I almost figured it out, just can't remember if the order is triggered, does the ticket take a value of -10?