indicator timeline

 

I have been struggeling with an issue for quite some time and cannot find the answer so I thought I ask the forum for the first time...

Im building an indicator in MT4.

I have a csv file with data, for example: <currency;date;number;number;...;...;..>

AUDUSD;021210;88976;7765;7774;45;...

AUDUSD;041210;89976;7721;7701;94;...

GBPUSD;041210;89976;9721;7731;91;....

..... etc

I have no problem parsing the file and adding numbers to it's specific array, for example..

double column3[], column4[];

SetIndexBuffer(0, column3);
SetIndexLabel(0, "column3");
SetIndexBuffer(1, column4);
SetIndexLabel(1, "column4");

while(FileIsEnding(readFile)==false) {
      row=FileReadString(readFile);
      if (row == StringSubstr(Symbol(),0,6)) {
         date[bufferCount] = FileReadString(readFile);
         column3[bufferCount]   = FileReadDouble(readFile);
         column4[bufferCount]   = FileReadDouble(readFile);
         .....
      }
}


I can't get anything to show in the indicator window. I guess I also have to loop through the Bars in some kind of way to attach the specific arrayvalue to be shown at the right X-axis(bar), if you understand what I mean..

Does anyone have any idea how to do this?


Regards

M

 

I solved the little problem.

Realized the buffercount is directly correlated to the Bars.


However, I just want to populate every 5:th array-box...

So I fill in default 0 for those array-boxes I don't have any value in, with the result the line is going down to 0 between every value. This is however not the way I want it, would like the line to ignore the 0 value and just draw a line between every 5:th box where I put a value...

I have tryed to set SetIndexEmptyValue but this only results in that nothing is showing...

Any ideas?


/M

 
kanonmicke:

I solved the little problem.

Realized the buffercount is directly correlated to the Bars.


However, I just want to populate every 5:th array-box...

So I fill in default 0 for those array-boxes I don't have any value in, with the result the line is going down to 0 between every value. This is however not the way I want it, would like the line to ignore the 0 value and just draw a line between every 5:th box where I put a value...

I have tryed to set SetIndexEmptyValue but this only results in that nothing is showing...

Any ideas?


/M


it's so nice when people discuss with themself :D
Reason: