let`me explain a bit better: i need an indicator that read from a CVS file and plot the values in a sub-window, the CVS will have 2 values comma separated, the first value is the date and the second is the actually value that the indicator should plot.
let`me explain a bit better: i need an indicator that read from a CVS file and plot the values in a sub-window, the CVS will have 2 values comma separated, the first value is the date and the second is the actually value that the indicator should plot.
for example
the CVS look like this:
Time,value
2016.10.26.21.20,127.765
2016.10.26.21.15,127.777
2016.10.26.21.10,127.777
2016.10.26.21.05,127.799
2016.10.26.21.00,127.791
2016.10.26.20.55,127.788
the indicator will plot the value accordingly to the date
i hope its a bit more clear now..
Thanks for your help friend!
That`s what i have accomplished so far:
externstring FileName = "AUDCAD.CSV";
datetime dt[9999];
double val[9999];
string arr[2];
int h = FileOpen(FileName, FILE_CSV|FILE_READ,'~');
if (h==0) Comment("File "+FileName+" not found.");
for (int c=0; !FileIsEnding(h) && c<9999; c++) {
string tmp = FileReadString(h);
if (FileIsEnding(h)) break;
StrToStringArray(tmp,arr,",");
dt[c] = StrToTime(arr[0]); // <==== This should convert the date value (in the format of "yyyy.mm.dd hh:mi") to datatime type and assign it to the array
val[c] = StrToNumber(arr[1]); // <==== This will assign the value to the array
}
FileClose(h);
//+------------------------------------------------------------------+void StrToStringArray(string str, string &a[], string delim=",") {
//+------------------------------------------------------------------+int z1=-1, z2=0;
for (int i=0; i<ArraySize(a); i++) {
z2 = StringFind(str,delim,z1+1);
a[i] = StringSubstr(str,z1+1,z2-z1-1);
if (z2 >= StringLen(str)-1) break;
z1 = z2;
}
}
//+------------------------------------------------------------------+double StrToNumber(string str) {
//+------------------------------------------------------------------+// Usage: strips all non-numeric characters out of a stringint dp = -1;
int sgn = 1;
double num = 0.0;
for (int i=0; i<StringLen(str); i++) {
string s = StringSubstr(str,i,1);
if (s == "-") sgn = -sgn; elseif (s == ".") dp = 0; elseif (s >= "0" && s <= "9") {
if (dp >= 0) dp++;
if (dp > 0)
num = num + StrToInteger(s) / MathPow(10,dp);
else
num = num * 10 + StrToInteger(s);
}
}
return(num*sgn);
}
I`m not sure why if i Print dt[c] it always return the same value..like time never change even if the arr[0] change on every iteration of the loop..
after this we should assign the value to the bar with that time..but im stuck..
let`me explain a bit better: i need an indicator that read from a CVS file and plot the values in a sub-window, the CVS will have 2 values comma separated, the first value is the date and the second is the actually value that the indicator should plot.
for example
the CVS look like this:
Time,value
2016.10.26.21.20,127.765
2016.10.26.21.15,127.777
2016.10.26.21.10,127.777
2016.10.26.21.05,127.799
2016.10.26.21.00,127.791
2016.10.26.20.55,127.788
the indicator will plot the value accordingly to the date
i hope its a bit more clear now..
Thanks for your help friend!
That`s what i have accomplished so far:
Nevermind i have solved the problem....the SrtToTime only accept string with this format: "yyyy.mm.dd hh:mi" that means that i was loading a CSV with this format instead "yyyy.mm.dd hh.mi" and obviously was giving me an error.. anyway i solved!!
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi guys and code gurus,
i`m looking for a simple indicator that plots its own values from a CSV file. Can someone please help me?
Thanks in advance!
What does the "its own value" mean?
Thanks mladen,
let`me explain a bit better: i need an indicator that read from a CVS file and plot the values in a sub-window, the CVS will have 2 values comma separated, the first value is the date and the second is the actually value that the indicator should plot.
for example
the CVS look like this:
the indicator will plot the value accordingly to the date
i hope its a bit more clear now..
Thanks for your help friend!
Dear Friend,
i need to coding,
candle close then if candle is UP then alert UP and candle is DOWN then alert DOWN any time frame
if you have pls share me,
thank you in adance,
- jesing
Thanks mladen,
let`me explain a bit better: i need an indicator that read from a CVS file and plot the values in a sub-window, the CVS will have 2 values comma separated, the first value is the date and the second is the actually value that the indicator should plot.
for example
the CVS look like this:
Time,value
2016.10.26.21.20,127.765
2016.10.26.21.15,127.777
2016.10.26.21.10,127.777
2016.10.26.21.05,127.799
2016.10.26.21.00,127.791
2016.10.26.20.55,127.788
the indicator will plot the value accordingly to the date
i hope its a bit more clear now..
Thanks for your help friend!
That`s what i have accomplished so far:
AtApi:
Thanks mladen,
let`me explain a bit better: i need an indicator that read from a CVS file and plot the values in a sub-window, the CVS will have 2 values comma separated, the first value is the date and the second is the actually value that the indicator should plot.
for example
the CVS look like this:
Time,value
2016.10.26.21.20,127.765
2016.10.26.21.15,127.777
2016.10.26.21.10,127.777
2016.10.26.21.05,127.799
2016.10.26.21.00,127.791
2016.10.26.20.55,127.788
the indicator will plot the value accordingly to the date
i hope its a bit more clear now..
Thanks for your help friend!
That`s what i have accomplished so far:
hello
mr mladen:
could update it for new mt4 build
best regard
Please can anyone help me fix these 3 issues
1. fix the trailing error
2.remove the second time frame filter,system will run on 30m chat
3.add the attached indicator as a filter on the 1D chat
@Dear friends,
My ea gives the below error,.
"EURUSD+,M5: unknown ticket 21847676 for OrderDelete function"
What does this sentence mean? What is the problem and what can i do?
@Dear friends,
My ea gives the below problem.
"EURUSD+,M5: unknown ticket 21847676 for StringConcatenate(function"
What does this sentence mean? What is the problem?
What can i do?
It means that it can not find an order with ticket number 21847676 that it can delete
Either :
hello mr mladen
could you help to put this indicator on MTF separate chart similar this picture
regard