SymbolSelect(SYM,false) - isn't it working - or do I do something wrong? - page 2

 

Sorry, this is the right code:

dgts=MarketInfo(SYM,MODE_DIGITS);
if (GetLastError()>0){
   //SYM is not on Market Watch
   SymbolSelect(SYM,true);
   dgts==MarketInfo(SYM,MODE_DIGITS);
   SymbolSelect(SYM,false);
   }


 

 
This has the same problem as previously mentioned, i.e. not testing for 4066/4073 and waiting for the download to complete.
 

Guys, hello.

I am trying to grab prices, using iClose() basically, from other symbols only under D1, but no data is loaded.

I just tried using the example from Carl (https://www.mql5.com/en/forum/159114#comment_3813774) but it continues running non-stop without data.


Debugging another code I am working on, I could see that it raises error 4073 (NO HISTORY DATA)

Considering this, I wonder what is the point that iClose() allows Symbol and Timeframe as parameters if it does not load data?

SymbolSelect(SYM,false) - isn't it working - or do I do something wrong?
SymbolSelect(SYM,false) - isn't it working - or do I do something wrong?
  • 2016.05.15
  • www.mql5.com
I have written a loop within a script to get some symbol spec.s: Firstly I bring the symbol in the MarketWatch (SymbolSelect(SYM,true...
 
Aecio de Feo Flora Neto: I am trying to grab prices, using iClose() basically, from other symbols only under D1, but no data is loaded.
  1. Why didn't you read the comment directly above? #12
    This has the same problem as previously mentioned, i.e. not testing for 4066/4073 and waiting for the download to complete.
  2. See Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum
 
whroeder1:
  1. Why didn't you read the comment directly above? #12
  2. See Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum
Does it work also when market is closed?
 
Aecio de Feo Flora Neto:
Does it work also when market is closed?

Maybe quite easy to try.

 
Aecio de Feo Flora Neto:
Does it work also when market is closed?

The symbol has to present in the MarketWatch - use SymbolSelect() for that.

If it is an indicator Sleep doesn't work, so you only can leave OnCalculate() and either wait for the next tick or restart the indicator..

 

According to tests I did, here goes my findings:

1. Market has to be opened in order to load history. This is very bad, IMHO.

2. Symbol has to be loaded in a chart at least once in target timeframe.


I am only building code in script due to nature of how indicator works.


I really don't understand why this has to be this way, it raises many limitations in the platform this way.

 

No its not you can press F2 and download any available symbol in history center even when markets closed.

 
Marco vd Heijden:

No its not you can press F2 and download any available symbol in history center even when markets closed.


Not from broker, but from metaquotes. Not sure it is a good idea.