Problem with SymbolName (int pos, bool selected ) function. Symbol that is not in Market Window appears, althought selected bool true. - page 2

 

I have also changed for loop properties.


And it also works:


for(int i = 0  ; i < NumberOfSymbols - 1 ;i++)
      if(!m_combo_box.AddItem ( SymbolName ( i, true ) ) )
         return(false);     


Previously I had like this :


for(int i = 1 ; i < NumberOfSymbols ; i++)
     { if(!m_combo_box.AddItem ( SymbolName ( i, true ) ) )
         return(false);      }

 

I have already updated this above, in topic question, cause I saw many questions about creating inputs with dynamically creating Symbol options.

 
Michal Herda #:

I have also changed for loop properties.


And it also works:



Previously I had like this :


It should be 

for(int i = 0  ; i < NumberOfSymbols ;i++)
      if(!m_combo_box.AddItem ( SymbolName ( i, true ) ) )
         return(false);   

Your current fix misses the last symbol in market watch.

Your previous attempt missed the first symbol.

 

It looks okay :


SymbolsTotal

 
Michal Herda #:

It looks okay :


Run again without ommiting 1 from the total..

 

Without subtraction from the total :


Without \"-1\"

 
Michal Herda #:

Without subtraction from the total :



Well, you can see that's correct - USDPLN should be included

 

You can add something like that to make the unvisible symbols visible

      for(int i = 0  ; i < NumberOfSymbols ; i++)
        {
         if(!SymbolInfoInteger(SymbolName(i,true),SYMBOL_VISIBLE))
            SymbolSelect(SymbolName(i,true),true);
         if(!m_combo_box.AddItem(SymbolName(i, true)))
            return(false);
        }
Or find an alternative, because you have USDPLN selected again as last symbol in the market but it's invisible.
 


Okay, I don't know if I'm gonna finish this project at all.

In the meantime, other problems arose:


1. Account Currency

2. The distinction between PIP and Points

3. Knowing life, something may still appear, although it is even hard to imagine what it might be.


I have to consider doing something more useful

I thought this is one evening job (like hobby, relaxation task), and now I've been working on it for a bit longer

Reason: