![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Postponed:
Gevorg Hakobyan, 2016.12.08 15:26
Hello. How can I get a list of all existing currency pairs in Meta Trader 4? And how can I keep abreast of any changes in the list?SymbolsTotal
Returns the number of available (selected in MarketWatch or all) symbols.
intSymbolsTotal(
bool selected// true - only symbols in MarketWatch
);
Parameters
selected
[in] Request mode. Can take values true or false.
Returned value
If selected is true, the number of characters selected in MarketWatch is returned. If false, it returns the total number of all symbols.
https://docs.mql4.com/ru/marketinformation/symbolstotal
There are many functions there, see what you need from that section
https://docs.mql4.com/ru/marketinformation/symbolname
First we get the list of all symbols:
//| AllSymbols.mq5 |
//| Copyright © 2016, Vladimir Karputov |
//| http://wmua.ru/slesar/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2016, Vladimir Karputov"
#property link "http://wmua.ru/slesar/"
#property version "1.00"
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
int count=SymbolsTotal(false); // false - all symbols in MarketWatch
for(int i=0;i<count;i++)
Print(i,": ",SymbolName(i,false));
}
//+------------------------------------------------------------------+
Here we use the enumeration of all symbols available in MarketWatch.
But just a list will not give us anything. In order to get the properties of a symbol, we must first select it(SymbolSelect).
First we get a list of all the symbols:
This uses a search against all the symbols available in MarketWatch.
But just a list will not give you anything. In order to get the properties of a symbol, you must first select it(SymbolSelect).
Good day everyone! Can you please advise how to set an order deletion in an EA?
The situation is as follows:
We place 2pending orders in different directions, as soon as one of them triggers, the other is removed and is no longer exhibited.
I would be very grateful for any help.
I will be very thankful for it.
Good day everyone! Can you please advise how to set an order deletion in an EA?
The situation is as follows:
We place 2pending orders in different directions, as soon as one of them triggers, the other is removed and is no longer exhibited.
I would be very grateful for any help.
Thank you.
If the amount of pending orders is less than 2, delete the one that remained.
If we do not want to return the pending order, it is more difficult, we have to analyze the time and conditions for placing the order.