Problem with export D1 data in real time

 
 
castann86: the code not work for D1.
  1. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
  2. int handle_read1 = FileOpen("GBPUSD"+"_D1"+"_result.csv",FILE_CSV|FILE_READ,';');
    if(handle_read1 >= 0)
    :
    int handle_read2 = FileOpen("AUDCAD"+"_D1"+"_result.csv",FILE_CSV|FILE_READ,';');
    if(handle_read2 >= 0)
    Above you know that zero is valid handle. So why don't you know it later?
      handle = FileOpen(filename,FILE_CSV|FILE_WRITE,';');
      if(handle < 1)
    :
      handle1 = FileOpen(filename1,FILE_CSV|FILE_WRITE,';');
      if(handle1 < 1)
    :
      handle2 = FileOpen(filename2,FILE_CSV|FILE_WRITE,';');
      if(handle2 < 1)
 
WHRoeder:
  1. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
  2. Above you know that zero is valid handle. So why don't you know it later?
i think i understand, but for to learn of my mistakes:

1- Why, the code has the requeriment results for EURUSD and no for GPBUSD and AUDCAD?

2- Why this code has the requeriment results for other timeframes for this currencies?

I dont know this two situations.

Thank you for your reply WHRoeder
 
What a mistake I'm making?
thank you very much
 

Any help?

 i dont understand why the code not have the requirement results

Thank you very much 

 
castann86:  i dont understand why the code not have the requirement results
Asked and answered.
  1. You expect mind readers. "not have required results" is meaningless. You fail to state what is does, you fail to state what is should do.
  2. You fail to think. I reminded you that "zero is a valid handle" and you changed your code to:
      handle = FileOpen(filename,FILE_CSV|FILE_WRITE,';');
      if(handle >= 0)
      {
        Print(" #", GetLastError());
        return(0);
    You try open the file. If it is successful, you return, loosing the handle, keeping the file open, and nothing works after that.
 

hello,

I copied all your code and compiled in my pc but it did not worked, even for other timeframes. So, are you sure it does work at all?  

 
Demos: I copied all your code
I didn't post any code. You fail to think.
 
Demos:

hello,

I copied all your code and compiled in my pc but it did not worked, even for other timeframes. So, are you sure it does work at all?  

Yes Demos, 

for other timeframes the code worked well.

I dont understand

 

Thank you very much 

 
WHRoeder:
Asked and answered.
  1. You expect mind readers. "not have required results" is meaningless. You fail to state what is does, you fail to state what is should do.
  2. You fail to think. I reminded you that "zero is a valid handle" and you changed your code to:
    You try open the file. If it is successful, you return, loosing the handle, keeping the file open, and nothing works after that.

Hi WHRoeder,

i only am learning mql4, and i built indicators that can be usefull in future for me.

i dont understand some things .

I dont understand Why the indicator work for other timeframes and no work for D1.

With your post, you want say that i must no use return(0) in this situation because if i use return(0), i loose the handle.

It is correct? 

Reason: