File write in 2 subfolders

 
Hi, 
I need help.
I have 2 experts with function FileWrite and everythig is working - the files are write into the standard folder in terminal.
I want make in the standard folder 2 subfolders and write the files into them( file1 into subfolder1, file2 into subloder2)

Any idea how?
 

You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help (2017.04.21)

  1. Make the «DataFolder»/MQL4/Files/subfolders and «DataFolder»/tester/files/subfolders.
  2. Add the subfolder names to your FileOpen calls.
 

I´m sorry,

this is the part of the Code:

And I want File 1 to another folder than the File 2.


       

 

void OnTick()

  {       //začátek

 

         //Filename

        string   FileName = "Filesdata.csv";

        string   FileName1 = "FIlesdata1.csv";

 

        //Data

        int V1 = Volume[1];

        int V2 = Volume[2];

        int C1 = Close[1];

        int C2 = Close[2];

        string Cas= TimeToString(Time[0],TIME_DATE|TIME_MINUTES);    



         //Podmínka 1 

        if((Volume[0]==1))

        {      



        // 1 File      


        

            //Create and Open file

            int handle=FileOpen(FileName,FILE_CSV|FILE_READ|FILE_WRITE,";");

           

            //Name column headers

            FileWrite(handle,"Open Timestamp","Volume 1","Volume 2");

           

            //Go to end of file

            FileSeek(handle,0,SEEK_END);

           

            //Record Indicator values

            FileWrite(handle,Cas,V1,V2);

           

            //Close file

            FileClose(handle);  

         

          // 2 File         

                

            //Create and Open file

            int handle1=FileOpen(FileName1,FILE_CSV|FILE_READ|FILE_WRITE,";");

           

            //Name column headers

            FileWrite(handle1,"Open Timestamp","Close 1","Close 2");

           

            //Go to end of file

            FileSeek(handle1,0,SEEK_END);

           

            //Record Indicator values

            FileWrite(handle1,Cas,C1,C2);

           

            //Close file

            FileClose(handle1); 

               

    }

  

  }         //end

 

Thanks for help.

 
  1. mkotalik33 #:Thanks for help.

    Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem. Where have you "Add the subfolder names to your FileOpen calls."
              No free help (2017.04.21)

  2.         if((Volume[0]==1))

    For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
              New candle - MQL4 programming forum #3 (2014.04.04)

    I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
              Running EA once at the start of each bar - MQL4 programming forum (2011.05.06)

 
William Roeder #:
  1. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem. Where have you "Add the subfolder names to your FileOpen calls."
              No free help (2017.04.21)

  2. For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
              New candle - MQL4 programming forum #3 (2014.04.04)

    I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
              Running EA once at the start of each bar - MQL4 programming forum (2011.05.06)

  Thanks for your advice about the bars.
Reason: