Select a symbol in the settings - page 3

 
Alexey Viktorov:

Fill an array of characters and work with the array.

There's a free EA using the above piece of code ***


ps; drubashka, you should have removed the link. Among my products in the marketplace, only TWO are paid. One from 2017 has been rented 4 times, and the other from 2014 for 10 quid hasn't been bought once. So there's no advertising to be expected here.

I don't know why I joined this thread - now I'm struggling, and it's not working. I'm still looking for a way to make it work.

I don't know, maybe this will work.

struct translate{
   string EURUSD;
   string GBPUSD;
   string USDCHF;
   string USDJPY;
   string USDCAD;
   string AUDUSD;
   string AUDNZD;
   string AUDCAD;
   string AUDCHF;
   string AUDJPY;
   string CHFJPY;
   string EURGBP;
   string EURAUD;
   string EURCHF;
   string EURJPY;
   string EURNZD;
   string EURCAD;
   string GBPCHF;
   string GBPJPY;
   string CADCHF;
};
translate langs;
 
Aleksandr Klapatyuk:

Thank you for answering. I don't know why I came to this thread - now I'm struggling and can't get it to work.

I don't know, maybe this will work.

You are wasting your time. You won't be able to fill the structure or the enum programmatically. And the array can only be used for a multi-currency EA. Multicurrency EA is not the one that can be put on any symbol, but one that can trade several symbols while being on one of the charts. In that link you can see an example of such a multicurrency EA. Selection of currencies can be set to one of three options:

  1. only the pair on which the Expert Advisor is traded
  2. a comma-separated list of currencies will be traded
  3. all pairs opened at the moment of launching the Expert Advisor are traded
But the options are selected via enum
 
Alexey Viktorov:

You should not be doing this. Neither the structure nor the enum can be filled in programmatically. And the array can only be used for a multicurrency EA. Multicurrency EA is not the one that can be set to any symbol, but one that is on one of the charts and can trade several symbols. In this link there is an example of such a multicurrency EA. Selection of currencies can be set to one of three options:

  1. only the pair on which the Expert Advisor is traded
  2. a comma-separated list of currencies will be traded
  3. all currency pairs open at the moment of launching the Expert Advisor are traded
But the options are selected via enum

Thanks! I started doing something I can`t afford. I`d rather learn something easier.

I have done this before - it all worked.

string         Symb[3]={"EURUSD","GBPUSD","EURJPY"};
double         prPos[3];
------------------------------------------------------------
   for(int i=0;i<3; i++)
      if(PositionSelect(Symb[i]))
        {
         prPos[i]=(PositionGetDouble(POSITION_PROFIT)/PositionGetDouble(POSITION_VOLUME)/SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE))/n;
        }
      else
        {
         prPos[i]=0;
        }
 
Aleksandr Klapatyuk:

Thanks! I'm doing something I can't do. I'd rather learn something easier.

That's how I did it - it all worked.

This is the second option I described. Trade currencies from the list prepared in a comma-separated line. But my version is a little different. The list looks like this

"EURUSD,GBPUSD,EURJPY"

then the array is filled from this list and the array is worked with. In addition, the currency suffix is defined and automatically appended whenthe array is filled. This is to avoid having to retype the list in different accounts.

 
Alexey Viktorov:

We are not talking about the same thing.

simv

syTotal = SymbolsTotal(true) seems to always be 1, because if true, SymbolTotal() will not show the number of symbols in Market Watch, but the number of selected symbols in Market Watch and this raises the question of how to step through the list before selecting the next item.

 
andre:


syTotal = SymbolsTotal(true) seems to always be 1, because if true, SymbolTotal() does not give the number of symbols in Market Watch, but the number of selected symbols in Market Watch and this raises the question of how to step through the list before selecting the next item.

In the tester, yes, there is always one symbol. That's why there is a warning in the EA description, that in the tester you can only test on one symbol or on a list of symbols.

 
Unfortunately, to make it nice, you have to draw the input panel yourself, implement a drop-down list, in general, nothing fundamentally complicated, but cloudy. If religion and/or customer allow, then it's easier to implement it on Sharp, through windowsform. As for the technical possibility to do it in the standard panel, I don't see any problems in principle, it's more a question of the creators desire. It is possible to implement providing selection of values, for compiler only we should introduce additional keywords, to write like: __declsymb input string value=__default(or __pos1), in general the developers of compiler/terminal have to develop it.
 
Vladimir Simakov:
Unfortunately, to make it nice, you have to draw the input panel yourself, implement a drop-down list, in general, nothing fundamentally complicated, but cloudy. If religion and/or customer allow, then it's easier to implement it on Sharp, through windowsform. As for the technical possibility to do it in the standard panel, I don't see any problems in principle, it's more a question of the creators desire. It is possible to implement providing selection of values, for compiler only we should introduce additional keywords to write like: __declsymb input string value=__default(or __pos1), in general the developers of compiler/terminal have to develop it.

Well, yes. If you use dll, you can play tanks on the terminal. But the problem was raised without taking into account the capabilities of dll

 
Alexey Viktorov:

Well, yes. If you use the dll, you can also play tanks on the terminal. But the problem was raised without taking into account the capabilities of the dll

Then either pray to the creators or write your own input panel. At start of robot (more complicated with indicator) in OnTimer() there is started self-written input panel, input data, then robot has gone to work. It goes like this.
 
Vladimir Simakov:
Then either pray to the creators, or write your own input panel. When robot starts (more complicated with indicator) self-written input panel is launched in OnTimer(), data is entered, then robot started working. It goes like this.

First you have to ask, "Who needs it?"

I would like to try it but it did not work. I told the Expert Advisor that it cannot be done using MQL. But nobody asked him how to do it using other means. What's the point of all this nonsense? There are enough people here who can draw cartoons on the terminal chart.