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
The problem seems to be something else.
The value "3" does not return in any way :) After all, the enumerations are numbered from zero.Rosh:
The problem seems to be elsewhere.
Value "3" does not return in any way :) Because enumerations are numbered from zero.Use the EnumToString function to output enumeration values
The strange thing is that this suggestion didn't come up earlier, when the author of the local topic was stating his results as"Returns 3". OK, let's go down the unbeaten path.
Returns 3 - that is, SYMBOL_TRADE_EXECUTION_MARKET.
Following Roche's advice we write a simple check (using EnumToString):
And what do we see? - What we see is that number "3" does not correspond to SYMBOL_TRADE_EXECUTION_MARKET. So we return to https://www.mql5.com/ru/forum/3775/page143#comment_192116
In MQL5, values of periods of type PERIOD_M1 ... PERIOD_MN1 are values of the integer type? I want to compare them using the switch operator. For example, is the expression:
Hello, can you tell me how to check if Buy and Sell for a certain instrument were closed today?
If no one will post the ready code, then try to write it yourself. Probably the easiest approach is as follows: select the history of deals for a particular day(HistorySelect) and try to search the history for deals that refer to the selected symbol
DEAL_SYMBOL
Name of the symbol for which the deal has been made
string
then check
DEAL_TIME
Deal time
datetime
и
DEAL_ENTRY_OUT
Market exit
If there were several closing positions for one symbol during the day, you can also get the time of each deal and process it according to the author's algorithm.
The strange thing is that this suggestion was not made earlier, when the author of the local topic was stating his results as"Returns 3". OK, let's go down the unbeaten path.
Following Roche's advice, we write a simple check (using EnumToString):
And what do we see? - What we see is that number "3" does not correspond to SYMBOL_TRADE_EXECUTION_MARKET in any way. So we go back to https://www.mql5.com/ru/forum/3775/page143#comment_192116.
How about this? :)
Returns 3 - that is SYMBOL_TRADE_EXECUTION_MARKET
3 is SYMBOL_TRADE_EXECUTION_EXCHANGE logically.
You'd better tell us what and where we are trying to trade... :)
How about this? :)
Well, it's the same thing. Only from another angle. Number "3" and value of enumeration"SYMBOL_TRADE_EXECUTION_MARKET" are not related at all.Except maybe by the precedence relation.
3 is SYMBOL_TRADE_EXECUTION_EXCHANGE logically.
It's not that "logically", but that's just how it is at the moment.
Well, it's the same thing. Only from a different angle. The number "3" and value of the"SYMBOL_TRADE_EXECUTION_MARKET" enumerationare not related in any way.The only difference is in the precedence relation.
It's not that "logically", but that's just how it is at the moment.
So it makes sense, we have exchange execution(SYMBOL_TRADE_EXECUTION_EXCHANGE) and therefore no TP/SL