Backtesting with tick data - page 2

To add comments, please log in or register
mikey
129
mikey  

yep again, we missing each other. Could I basically scrap volume data by setting all volume values to 1?

gordon
2325
gordon  
mikey:

Yep. your reply just came up as I sent my last.

RE: volume...- if my EA doesnt "read" volume am I safe on this? Dont have to worry about that? I didnt think about volume - but then as I say my EA doesnt "read" it for anything. So, just to clarify - i can ignore volume? Or should I maybe set volume to 1 for all bars?

If your EA doesn't use the volume data, then it can be ignored. U have to set it to 1 for your method to work, otherwise the tester would create more than one tick per bar...
mikey
129
mikey  

Yep. I havent got any indicators looking at bars or anything like that. Swaps - that is a good point. Will bear it in mind. I am just keen to run this new method asap.

I am nearly all good to go if I can just solve this problem of doing the time shift. So, consider these bars (in a .csv text file):

NB: date,time,open,high,low, close,volume

20100831,18:00,71.75,71.75,71.75,71.75,1
20100831,18:00,71.75,71.75,71.75,71.75,1
20100831,18:01,71.75,71.75,71.75,71.75,1

So I want to change the time of the second bar to 18:01 so that the top 2 bars have different times (they do have different times on the sub-minute level of course, but I want them to have actually different timings on the minute level).

Then I will have to change the time of the third bar to 18:02. So, now all 3 bars have different times.

I think a good pseudo code for operation is:

time_of_next_bar = time_of_previous bar +1;

But then would have to have constraints in there to account for the fact that only 60 minutes then should be moving the hour, and eventually moving the date, the month etc.

THIS is what I am stuck on.I have all my bars in a .csv file and need to find some way to operate on them like this. Maybe using Perl? I looked in that MQl file you linked to and I couldnt see a transposable method for this.

mikey
129
mikey  

I guess maybe the easiest way is if I can just find a very very long list in 2 columns of dates and times from somewhere (with this format):

20100831,18:00

20100831,18:01

20100831,18:02

20100831,18:03

20100831,18:04

20100831,18:05

etc. etc.

Maybe better to find such a list than to generate one.

I can then just substitute these columns into my csv file. I have tried go along this route by for example exporting M1 data out of metatrader and then taking its columns. BUT the amount of historical M1 data that I can get for metatrader (a few months worth) isnt long enough for my purposes. Maybe if I had a few years worth could work.

zzuegg
1502
zzuegg  
mikey:

Yep. I havent got any indicators looking at bars or anything like that.

are you shure about that? nearly all indicator use bars in their calculations... all indicators where you can set a period will probaly fail. all high[] low[] open[] close[] calls will fail, basically all timeseries access functions are affected.

i on your case would inspect the files on the website to create a custom tick file and use a patched terminal.

gordon
2325
gordon  

Here's a simple script to do the job. I checked it once only, so take care for overlooked bugs... Also - its probably not the fastest/best way to do it.

#property show_inputs
extern string     src_file = "sample.csv";             // source file name
extern string     trg_file = "output.csv";             // target file name
extern datetime   st_date = D'2000.01.01 00:00';       // start date for written data (this could be whatever...)

int start()
{
   string sclose;             // tick close price - we assume O=H=L=C
   
   // get handles for source and target file (NOTE: will overwrite target file if exists!!)
   int src_handle = FileOpen(src_file, FILE_CSV|FILE_READ, ',');
   int trg_handle = FileOpen(trg_file, FILE_CSV|FILE_WRITE, ',');
      
   // read each line from source, process it and write to target
   while(!FileIsEnding(src_handle)) {
      // read data from source by fields (convinient since it's a CSV file)
      FileReadString(src_handle);    // skip date     
      FileReadString(src_handle);    // skip time
      FileReadString(src_handle);    // skip open
      FileReadString(src_handle);    // skip high
      FileReadString(src_handle);    // skip low
      sclose = FileReadString(src_handle);   // GET CLOSE PRICE
      FileReadString(src_handle);    // skip volume
      
      // build output line as a single string (it's just simpler to do it this way)
      string output = StringConcatenate(
                        TimeToStr(st_date,TIME_DATE), ",",    // proper date and time format
                        TimeToStr(st_date,TIME_MINUTES), ",",
                        sclose, ",",      // to make sure OHLC are identical we just use close price
                        sclose, ",",
                        sclose, ",",
                        sclose, ",",
                        "1"               // this is fixed volume = 1 so as we'll have 1 tick per bar only
                      );          

      FileWrite(trg_handle,output);
      st_date += 60;                      // add 1 minute (60 seconds) to our time counter
   } // end while
   
   // close source and target file
   FileClose(src_handle);        
   FileClose(trg_handle);
   return(0);
}

Script is pretty self-explanatory... Source file should be in 'experts/files' folder. For start date u can input whatever, since time will be stretched anyway so timestamps are meaningless...


I still have serious doubts about what u r trying to do, but will be happy if you report your findings here anyway. Good luck.

mikey
129
mikey  
gordon:

Here's a simple script to do the job. I checked it once only, so take care for overlooked bugs... Also - its probably not the fastest/best way to do it.

Script is pretty self-explanatory... Source file should be in 'experts/files' folder. For start date u can input whatever, since time will be stretched anyway so timestamps are meaningless...


I still have serious doubts about what u r trying to do, but will be happy if you report your findings here anyway. Good luck.


This is brilliant!! Thanks!!

BUT I havent got it working just yet. So, I take your MLQ4 code, save and compile it and attach it to a symbol CL graph (and I tick the box for "Allow live trading") - in the log can see that this is loaded ok etc.

As a PRELUDE/SET UP to this, I have created 2 files:

sample.csv (with the data in) - have created a file with not much data in it for testing so that this all happens fast when we trying to get it all to work

output.csv (empty)

Have put them BOTH in experts/files. BUT I don't see any data being written into output.csv. Have I put the output.csv file in the correct place? Should I even make my own empty output.csv file? Is this the correct thing to do?

PS> Just in case has any bearing at all - have cut and paste my sample.csv below:

20100831,18:00,71.70,71.70,71.70,71.70,2
20100831,18:00,71.70,71.70,71.70,71.70,1
20100831,18:00,71.70,71.70,71.70,71.70,1
20100831,18:00,71.70,71.70,71.70,71.70,1
20100831,18:00,71.70,71.70,71.70,71.70,1
20100831,18:00,71.73,71.73,71.73,71.73,2
20100831,18:00,71.74,71.74,71.74,71.74,1
20100831,18:00,71.73,71.73,71.73,71.73,1
20100831,18:00,71.74,71.74,71.74,71.74,1
20100831,18:00,71.74,71.74,71.74,71.74,1
20100831,18:00,71.74,71.74,71.74,71.74,1
20100831,18:00,71.74,71.74,71.74,71.74,1
20100831,18:00,71.74,71.74,71.74,71.74,1
20100831,18:00,71.74,71.74,71.74,71.74,1
20100831,18:00,71.75,71.75,71.75,71.75,7
20100831,18:00,71.75,71.75,71.75,71.75,1
20100831,18:00,71.75,71.75,71.75,71.75,1
20100831,18:00,71.74,71.74,71.74,71.74,1
20100831,18:00,71.75,71.75,71.75,71.75,1
20100831,18:00,71.75,71.75,71.75,71.75,3
20100831,18:00,71.75,71.75,71.75,71.75,7
20100831,18:00,71.75,71.75,71.75,71.75,1
20100831,18:00,71.75,71.75,71.75,71.75,1
20100831,18:00,71.75,71.75,71.75,71.75,1
20100831,18:00,71.71,71.71,71.71,71.71,1
20100831,18:00,71.70,71.70,71.70,71.70,1
20100831,18:00,71.68,71.68,71.68,71.68,1
20100831,18:00,71.71,71.71,71.71,71.71,1
20100831,18:00,71.71,71.71,71.71,71.71,1
20100831,18:00,71.69,71.69,71.69,71.69,1
20100831,18:00,71.69,71.69,71.69,71.69,1
20100831,18:00,71.68,71.68,71.68,71.68,2
20100831,18:00,71.67,71.67,71.67,71.67,1
20100831,18:00,71.72,71.72,71.72,71.72,1
20100831,18:00,71.72,71.72,71.72,71.72,1
20100831,18:00,71.72,71.72,71.72,71.72,1
20100831,18:00,71.72,71.72,71.72,71.72,1
20100831,18:00,71.71,71.71,71.71,71.71,1
20100831,18:00,71.71,71.71,71.71,71.71,1
20100831,18:00,71.70,71.70,71.70,71.70,1
20100831,18:01,71.71,71.71,71.71,71.71,1
20100831,18:01,71.72,71.72,71.72,71.72,1
20100831,18:01,71.71,71.71,71.71,71.71,1
20100831,18:01,71.71,71.71,71.71,71.71,1
20100831,18:01,71.71,71.71,71.71,71.71,1
20100831,18:01,71.70,71.70,71.70,71.70,1
20100831,18:01,71.70,71.70,71.70,71.70,3
20100831,18:01,71.70,71.70,71.70,71.70,5
20100831,18:01,71.70,71.70,71.70,71.70,1
20100831,18:01,71.71,71.71,71.71,71.71,1
20100831,18:01,71.70,71.70,71.70,71.70,4
20100831,18:01,71.70,71.70,71.70,71.70,1
20100831,18:01,71.71,71.71,71.71,71.71,2
20100831,18:01,71.71,71.71,71.71,71.71,4
20100831,18:01,71.71,71.71,71.71,71.71,1
20100831,18:02,71.70,71.70,71.70,71.70,1
20100831,18:02,71.70,71.70,71.70,71.70,1
20100831,18:02,71.70,71.70,71.70,71.70,1
20100831,18:02,71.70,71.70,71.70,71.70,1
20100831,18:02,71.70,71.70,71.70,71.70,1
20100831,18:02,71.70,71.70,71.70,71.70,1
20100831,18:02,71.70,71.70,71.70,71.70,1
20100831,18:02,71.74,71.74,71.74,71.74,1
20100831,18:03,71.74,71.74,71.74,71.74,1
20100831,18:03,71.75,71.75,71.75,71.75,1
20100831,18:03,71.75,71.75,71.75,71.75,1
20100831,18:03,71.77,71.77,71.77,71.77,1
20100831,18:03,71.78,71.78,71.78,71.78,1
20100831,18:03,71.78,71.78,71.78,71.78,5
20100831,18:03,71.78,71.78,71.78,71.78,5
20100831,18:03,71.79,71.79,71.79,71.79,1
20100831,18:03,71.78,71.78,71.78,71.78,1
20100831,18:03,71.78,71.78,71.78,71.78,1
20100831,18:03,71.79,71.79,71.79,71.79,1
20100831,18:04,71.79,71.79,71.79,71.79,1
20100831,18:04,71.79,71.79,71.79,71.79,1
20100831,18:04,71.80,71.80,71.80,71.80,1
20100831,18:04,71.80,71.80,71.80,71.80,2
20100831,18:04,71.80,71.80,71.80,71.80,1
20100831,18:04,71.80,71.80,71.80,71.80,3
20100831,18:04,71.80,71.80,71.80,71.80,17
20100831,18:04,71.80,71.80,71.80,71.80,1
20100831,18:04,71.80,71.80,71.80,71.80,4
20100831,18:04,71.79,71.79,71.79,71.79,1
20100831,18:04,71.78,71.78,71.78,71.78,1
20100831,18:04,71.78,71.78,71.78,71.78,1
20100831,18:04,71.79,71.79,71.79,71.79,1
20100831,18:04,71.80,71.80,71.80,71.80,1
20100831,18:05,71.78,71.78,71.78,71.78,1
20100831,18:05,71.78,71.78,71.78,71.78,2
20100831,18:05,71.77,71.77,71.77,71.77,1
20100831,18:05,71.77,71.77,71.77,71.77,1
20100831,18:05,71.77,71.77,71.77,71.77,1
20100831,18:05,71.77,71.77,71.77,71.77,1
20100831,18:05,71.77,71.77,71.77,71.77,1
20100831,18:05,71.76,71.76,71.76,71.76,1
20100831,18:05,71.74,71.74,71.74,71.74,1
20100831,18:05,71.78,71.78,71.78,71.78,1
20100831,18:05,71.79,71.79,71.79,71.79,1
20100831,18:05,71.79,71.79,71.79,71.79,3
20100831,18:05,71.80,71.80,71.80,71.80,5
20100831,18:05,71.80,71.80,71.80,71.80,14
20100831,18:05,71.80,71.80,71.80,71.80,1
20100831,18:05,71.80,71.80,71.80,71.80,1
20100831,18:05,71.80,71.80,71.80,71.80,1
20100831,18:05,71.80,71.80,71.80,71.80,2
20100831,18:05,71.80,71.80,71.80,71.80,1
20100831,18:06,71.80,71.80,71.80,71.80,1
20100831,18:06,71.80,71.80,71.80,71.80,21
20100831,18:06,71.80,71.80,71.80,71.80,1
20100831,18:06,71.81,71.81,71.81,71.81,1
20100831,18:06,71.81,71.81,71.81,71.81,4
20100831,18:06,71.82,71.82,71.82,71.82,1
20100831,18:06,71.83,71.83,71.83,71.83,1
20100831,18:06,71.84,71.84,71.84,71.84,1
20100831,18:06,71.84,71.84,71.84,71.84,2
20100831,18:06,71.85,71.85,71.85,71.85,1
20100831,18:06,71.81,71.81,71.81,71.81,1
20100831,18:06,71.83,71.83,71.83,71.83,1
20100831,18:06,71.83,71.83,71.83,71.83,1
20100831,18:06,71.83,71.83,71.83,71.83,1
20100831,18:06,71.82,71.82,71.82,71.82,1
20100831,18:06,71.82,71.82,71.82,71.82,1
20100831,18:06,71.82,71.82,71.82,71.82,1
20100831,18:06,71.83,71.83,71.83,71.83,1
20100831,18:06,71.85,71.85,71.85,71.85,1
20100831,18:06,71.83,71.83,71.83,71.83,1
20100831,18:07,71.83,71.83,71.83,71.83,1
20100831,18:07,71.83,71.83,71.83,71.83,2
20100831,18:07,71.83,71.83,71.83,71.83,2
20100831,18:07,71.83,71.83,71.83,71.83,1
20100831,18:07,71.83,71.83,71.83,71.83,1
20100831,18:07,71.83,71.83,71.83,71.83,2
20100831,18:07,71.83,71.83,71.83,71.83,2
20100831,18:07,71.82,71.82,71.82,71.82,4
20100831,18:07,71.82,71.82,71.82,71.82,1
20100831,18:08,71.81,71.81,71.81,71.81,1
20100831,18:08,71.81,71.81,71.81,71.81,1
20100831,18:08,71.81,71.81,71.81,71.81,1
20100831,18:08,71.81,71.81,71.81,71.81,1
20100831,18:08,71.81,71.81,71.81,71.81,1
20100831,18:08,71.81,71.81,71.81,71.81,1
20100831,18:08,71.81,71.81,71.81,71.81,1
20100831,18:08,71.82,71.82,71.82,71.82,1
20100831,18:08,71.83,71.83,71.83,71.83,1
20100831,18:08,71.82,71.82,71.82,71.82,1
20100831,18:08,71.84,71.84,71.84,71.84,1
20100831,18:08,71.84,71.84,71.84,71.84,1
20100831,18:09,71.84,71.84,71.84,71.84,1
20100831,18:09,71.83,71.83,71.83,71.83,1
20100831,18:09,71.83,71.83,71.83,71.83,1
20100831,18:09,71.84,71.84,71.84,71.84,1
20100831,18:09,71.83,71.83,71.83,71.83,1
20100831,18:10,71.84,71.84,71.84,71.84,1
20100831,18:10,71.82,71.82,71.82,71.82,1
20100831,18:10,71.83,71.83,71.83,71.83,1
20100831,18:11,71.83,71.83,71.83,71.83,1
20100831,18:11,71.83,71.83,71.83,71.83,1
20100831,18:11,71.82,71.82,71.82,71.82,5
20100831,18:11,71.82,71.82,71.82,71.82,2
20100831,18:11,71.83,71.83,71.83,71.83,1
20100831,18:11,71.81,71.81,71.81,71.81,1
20100831,18:12,71.82,71.82,71.82,71.82,1
20100831,18:12,71.82,71.82,71.82,71.82,1
20100831,18:12,71.82,71.82,71.82,71.82,1
20100831,18:12,71.83,71.83,71.83,71.83,1
20100831,18:12,71.83,71.83,71.83,71.83,1
20100831,18:12,71.83,71.83,71.83,71.83,1
20100831,18:12,71.84,71.84,71.84,71.84,1
20100831,18:12,71.84,71.84,71.84,71.84,1
20100831,18:12,71.84,71.84,71.84,71.84,1
20100831,18:12,71.85,71.85,71.85,71.85,1
20100831,18:12,71.84,71.84,71.84,71.84,1
20100831,18:12,71.83,71.83,71.83,71.83,1
20100831,18:12,71.85,71.85,71.85,71.85,1
20100831,18:12,71.85,71.85,71.85,71.85,10
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.85,71.85,71.85,71.85,2
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.84,71.84,71.84,71.84,1
20100831,18:13,71.84,71.84,71.84,71.84,1
20100831,18:13,71.84,71.84,71.84,71.84,1
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.86,71.86,71.86,71.86,1
20100831,18:13,71.86,71.86,71.86,71.86,1
20100831,18:13,71.86,71.86,71.86,71.86,1
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:13,71.86,71.86,71.86,71.86,1
20100831,18:13,71.86,71.86,71.86,71.86,1
20100831,18:13,71.86,71.86,71.86,71.86,1
20100831,18:13,71.86,71.86,71.86,71.86,3
20100831,18:13,71.85,71.85,71.85,71.85,1
20100831,18:14,71.84,71.84,71.84,71.84,1
20100831,18:14,71.84,71.84,71.84,71.84,1
20100831,18:14,71.84,71.84,71.84,71.84,1
20100831,18:14,71.83,71.83,71.83,71.83,1
20100831,18:14,71.84,71.84,71.84,71.84,1
20100831,18:14,71.83,71.83,71.83,71.83,1
20100831,18:14,71.83,71.83,71.83,71.83,3
20100831,18:14,71.83,71.83,71.83,71.83,1
20100831,18:15,71.83,71.83,71.83,71.83,2
20100831,18:15,71.82,71.82,71.82,71.82,1
20100831,18:15,71.82,71.82,71.82,71.82,1
20100831,18:15,71.83,71.83,71.83,71.83,8
20100831,18:15,71.83,71.83,71.83,71.83,1
20100831,18:15,71.83,71.83,71.83,71.83,1
20100831,18:16,71.81,71.81,71.81,71.81,1
20100831,18:16,71.81,71.81,71.81,71.81,1
20100831,18:16,71.80,71.80,71.80,71.80,1
20100831,18:16,71.80,71.80,71.80,71.80,1
20100831,18:16,71.79,71.79,71.79,71.79,1
20100831,18:16,71.79,71.79,71.79,71.79,1
20100831,18:16,71.78,71.78,71.78,71.78,1
20100831,18:16,71.78,71.78,71.78,71.78,1
20100831,18:17,71.78,71.78,71.78,71.78,1
20100831,18:17,71.78,71.78,71.78,71.78,1
20100831,18:17,71.77,71.77,71.77,71.77,1
20100831,18:17,71.78,71.78,71.78,71.78,1
20100831,18:17,71.77,71.77,71.77,71.77,1
20100831,18:17,71.79,71.79,71.79,71.79,1
20100831,18:18,71.79,71.79,71.79,71.79,1
20100831,18:18,71.79,71.79,71.79,71.79,1
20100831,18:19,71.78,71.78,71.78,71.78,3
20100831,18:20,71.78,71.78,71.78,71.78,1
20100831,18:20,71.78,71.78,71.78,71.78,1
20100831,18:20,71.78,71.78,71.78,71.78,2
20100831,18:20,71.78,71.78,71.78,71.78,2
20100831,18:20,71.78,71.78,71.78,71.78,1
20100831,18:20,71.78,71.78,71.78,71.78,1
20100831,18:20,71.78,71.78,71.78,71.78,2
20100831,18:20,71.78,71.78,71.78,71.78,2
20100831,18:20,71.78,71.78,71.78,71.78,2
20100831,18:20,71.78,71.78,71.78,71.78,2
20100831,18:20,71.78,71.78,71.78,71.78,1
20100831,18:20,71.78,71.78,71.78,71.78,1
20100831,18:20,71.78,71.78,71.78,71.78,1
20100831,18:20,71.78,71.78,71.78,71.78,1
20100831,18:21,71.78,71.78,71.78,71.78,1
20100831,18:21,71.79,71.79,71.79,71.79,1
20100831,18:22,71.79,71.79,71.79,71.79,1
20100831,18:22,71.78,71.78,71.78,71.78,1
20100831,18:22,71.78,71.78,71.78,71.78,1
20100831,18:22,71.78,71.78,71.78,71.78,1
20100831,18:22,71.78,71.78,71.78,71.78,1
20100831,18:23,71.79,71.79,71.79,71.79,1
20100831,18:24,71.79,71.79,71.79,71.79,1
20100831,18:24,71.79,71.79,71.79,71.79,1
20100831,18:24,71.79,71.79,71.79,71.79,1
20100831,18:24,71.76,71.76,71.76,71.76,1
20100831,18:24,71.76,71.76,71.76,71.76,1
20100831,18:24,71.75,71.75,71.75,71.75,10
20100831,18:24,71.75,71.75,71.75,71.75,1
20100831,18:24,71.74,71.74,71.74,71.74,1
20100831,18:24,71.73,71.73,71.73,71.73,1
20100831,18:24,71.75,71.75,71.75,71.75,1
20100831,18:25,71.74,71.74,71.74,71.74,1
20100831,18:26,71.75,71.75,71.75,71.75,1
20100831,18:27,71.75,71.75,71.75,71.75,1
20100831,18:27,71.75,71.75,71.75,71.75,4
20100831,18:27,71.75,71.75,71.75,71.75,2
20100831,18:28,71.77,71.77,71.77,71.77,1
20100831,18:28,71.77,71.77,71.77,71.77,1
20100831,18:28,71.77,71.77,71.77,71.77,1
20100831,18:29,71.78,71.78,71.78,71.78,1
20100831,18:29,71.78,71.78,71.78,71.78,1
20100831,18:29,71.78,71.78,71.78,71.78,1
20100831,18:29,71.78,71.78,71.78,71.78,1
20100831,18:30,71.77,71.77,71.77,71.77,1
20100831,18:30,71.77,71.77,71.77,71.77,1
20100831,18:32,71.77,71.77,71.77,71.77,1
20100831,18:32,71.77,71.77,71.77,71.77,1
20100831,18:32,71.77,71.77,71.77,71.77,1
20100831,18:32,71.77,71.77,71.77,71.77,2
20100831,18:32,71.76,71.76,71.76,71.76,1
20100831,18:32,71.78,71.78,71.78,71.78,2
20100831,18:32,71.78,71.78,71.78,71.78,1
20100831,18:32,71.78,71.78,71.78,71.78,1
20100831,18:32,71.78,71.78,71.78,71.78,1
20100831,18:32,71.78,71.78,71.78,71.78,1
20100831,18:32,71.78,71.78,71.78,71.78,1
20100831,18:32,71.75,71.75,71.75,71.75,1
20100831,18:33,71.76,71.76,71.76,71.76,1
20100831,18:33,71.76,71.76,71.76,71.76,1
20100831,18:33,71.76,71.76,71.76,71.76,8
20100831,18:33,71.78,71.78,71.78,71.78,1
20100831,18:33,71.78,71.78,71.78,71.78,1
20100831,18:33,71.78,71.78,71.78,71.78,2
20100831,18:34,71.76,71.76,71.76,71.76,2
20100831,18:34,71.76,71.76,71.76,71.76,1
20100831,18:35,71.78,71.78,71.78,71.78,1
20100831,18:35,71.76,71.76,71.76,71.76,1
20100831,18:37,71.76,71.76,71.76,71.76,1
20100831,18:38,71.78,71.78,71.78,71.78,1
20100831,18:38,71.78,71.78,71.78,71.78,2
20100831,18:38,71.78,71.78,71.78,71.78,1
20100831,18:40,71.75,71.75,71.75,71.75,1
20100831,18:40,71.76,71.76,71.76,71.76,1
20100831,18:41,71.78,71.78,71.78,71.78,1
20100831,18:42,71.76,71.76,71.76,71.76,1
20100831,18:42,71.76,71.76,71.76,71.76,1
20100831,18:42,71.75,71.75,71.75,71.75,1
20100831,18:42,71.75,71.75,71.75,71.75,1
20100831,18:42,71.75,71.75,71.75,71.75,1
20100831,18:42,71.74,71.74,71.74,71.74,1
20100831,18:42,71.74,71.74,71.74,71.74,1
20100831,18:43,71.75,71.75,71.75,71.75,1
20100831,18:43,71.74,71.74,71.74,71.74,1
20100831,18:43,71.74,71.74,71.74,71.74,1
20100831,18:43,71.73,71.73,71.73,71.73,1
20100831,18:43,71.73,71.73,71.73,71.73,1
20100831,18:43,71.72,71.72,71.72,71.72,1
20100831,18:43,71.74,71.74,71.74,71.74,1
20100831,18:43,71.72,71.72,71.72,71.72,1
20100831,18:43,71.72,71.72,71.72,71.72,1
20100831,18:43,71.72,71.72,71.72,71.72,1
20100831,18:43,71.72,71.72,71.72,71.72,1
20100831,18:43,71.74,71.74,71.74,71.74,1
20100831,18:44,71.74,71.74,71.74,71.74,2
20100831,18:44,71.74,71.74,71.74,71.74,1
20100831,18:44,71.74,71.74,71.74,71.74,1
20100831,18:44,71.75,71.75,71.75,71.75,1
20100831,18:44,71.75,71.75,71.75,71.75,1
20100831,18:44,71.75,71.75,71.75,71.75,1
20100831,18:44,71.75,71.75,71.75,71.75,2
20100831,18:45,71.74,71.74,71.74,71.74,1
20100831,18:45,71.74,71.74,71.74,71.74,3
20100831,18:45,71.74,71.74,71.74,71.74,1
20100831,18:45,71.76,71.76,71.76,71.76,2
20100831,18:45,71.76,71.76,71.76,71.76,1
20100831,18:46,71.76,71.76,71.76,71.76,2
20100831,18:46,71.76,71.76,71.76,71.76,6
20100831,18:46,71.74,71.74,71.74,71.74,1
20100831,18:46,71.74,71.74,71.74,71.74,1
20100831,18:46,71.73,71.73,71.73,71.73,1
20100831,18:46,71.73,71.73,71.73,71.73,2
20100831,18:46,71.73,71.73,71.73,71.73,1
20100831,18:46,71.73,71.73,71.73,71.73,1
20100831,18:46,71.76,71.76,71.76,71.76,2
20100831,18:47,71.74,71.74,71.74,71.74,1
20100831,18:47,71.74,71.74,71.74,71.74,1
20100831,18:47,71.73,71.73,71.73,71.73,1
20100831,18:47,71.72,71.72,71.72,71.72,1
20100831,18:47,71.72,71.72,71.72,71.72,1
20100831,18:47,71.72,71.72,71.72,71.72,1
20100831,18:47,71.72,71.72,71.72,71.72,1
20100831,18:47,71.74,71.74,71.74,71.74,2
20100831,18:47,71.74,71.74,71.74,71.74,2
20100831,18:48,71.74,71.74,71.74,71.74,1
20100831,18:48,71.74,71.74,71.74,71.74,1
20100831,18:48,71.74,71.74,71.74,71.74,1
20100831,18:49,71.73,71.73,71.73,71.73,1
20100831,18:49,71.73,71.73,71.73,71.73,1
20100831,18:49,71.72,71.72,71.72,71.72,2
20100831,18:49,71.72,71.72,71.72,71.72,3
20100831,18:49,71.71,71.71,71.71,71.71,1
20100831,18:50,71.73,71.73,71.73,71.73,1
20100831,18:50,71.74,71.74,71.74,71.74,1
20100831,18:50,71.74,71.74,71.74,71.74,1
20100831,18:50,71.72,71.72,71.72,71.72,1
20100831,18:50,71.72,71.72,71.72,71.72,1

gordon
2325
gordon  
mikey:

BUT I havent got it working just yet. So, I take your MLQ4 code, save and compile it and attach it to a symbol CL graph (and I tick the box for "Allow live trading") - in the log can see that this is loaded ok etc.

As a PRELUDE/SET UP to this, I have created 2 files:

sample.csv (with the data in) - have created a file with not much data in it for testing so that this all happens fast when we trying to get it all to work

output.csv (empty)

Have put them BOTH in experts/files. BUT I don't see any data being written into output.csv. Have I put the output.csv file in the correct place? Should I even make my own empty output.csv file? Is this the correct thing to do?

  1. No need to create the output file, it will be created automatically (if it already exists it will be overwritten).
  2. Make sure this is compiled as a script.
  3. Make sure the sample file is in the 'experts/files' directory.
  4. Do you get any errors/messages in the experts tab?
gordon
2325
gordon  
I retested with your sample and it works. Attached - script, sample and the output (in a RAR archive).
Files:
files.rar 3 kb
mikey
129
mikey  

My mistake - put it as an EA as oppossed to a script. It WORKs now - as a script!

One thing tho - not a major drama - but the last line of the output file is thus:

2004.02.23,08:34,,,,,1

So is just an excess, redundant bit of data - no information lost when cut it. which is just what i did.

So, now am trying this with the strategy tester. Is running now - taking an age. But will keep u posted on everything.

To add comments, please log in or register