3 registered members (Akow, AndrewAMD, Quad),
733
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
How to use dataFromCSV
#485937
05/13/22 13:13
05/13/22 13:13
|
Joined: Mar 2021
Posts: 42 Casablanca, Morocco
anissyo
OP
Newbie
|
OP
Newbie
Joined: Mar 2021
Posts: 42
Casablanca, Morocco
|
Hello guys,
I need to use this function to read some CSV file, I am unable to figure out how this function works
dataFromCSV (int Handle, string Format, string Filename, int Column, int Offset)
what I don't understand is the Handle, the Format and Offeset.
cheers,
|
|
|
Re: How to use dataFromCSV
[Re: anissyo]
#485939
05/13/22 15:25
05/13/22 15:25
|
Joined: Mar 2021
Posts: 42 Casablanca, Morocco
anissyo
OP
Newbie
|
OP
Newbie
Joined: Mar 2021
Posts: 42
Casablanca, Morocco
|
I tried my friend i used this code :
#include <contract.c>
function run()
{
LookBack = 100;
set(LOGFILE);
BarPeriod = 600;
set(PLOTNOW);
int column = dataFromCSV (1,"CSV", "aaa", 1, 1);
print (TO_LOG,column);
}
all I get is : Error 058: Bad code 'C' for '2, "1.7 Cub' in aaa.csv PS: I have the CSV file in the history folder
|
|
|
Re: How to use dataFromCSV
[Re: anissyo]
#485944
05/13/22 16:06
05/13/22 16:06
|
Joined: Mar 2021
Posts: 42 Casablanca, Morocco
anissyo
OP
Newbie
|
OP
Newbie
Joined: Mar 2021
Posts: 42
Casablanca, Morocco
|
Hello guys, thanks for the replies, really appreciate it
this CSV file contains some breakouts that I detected using a python script, I want to take those break out and add them as signals in my zorro script so the format is irrelevant I guess since the format of the column is as follow: "YYYY/MM/DD strong up" or "YYYY/MM/DD medium up" or "YYYY/MM/DD weak down" etc. I just want to get the values from the CSV, regardless of what format is being used.
By the way Andrew I use occasionally CSVtoHistory to convert my data to T format, and I don't see datafromCSV used in the script...
Last edited by anissyo; 05/13/22 16:13.
|
|
|
Re: How to use dataFromCSV
[Re: anissyo]
#485946
05/13/22 16:27
05/13/22 16:27
|
Joined: Mar 2021
Posts: 42 Casablanca, Morocco
anissyo
OP
Newbie
|
OP
Newbie
Joined: Mar 2021
Posts: 42
Casablanca, Morocco
|
I want to extract the data from that CSV, every cell contains a date followed by "strong up" or "medium down" etc. but the format is as follows: "YYYY/MM/DD strong up" every cell contains values extracted from an end-of-day candles break-out detector that I coded in python.
and I will write a c lite script to check if I am on a break-out day and then try some intraday strategies to see the result, how to get the CSV values? lol
Last edited by anissyo; 05/13/22 16:29.
|
|
|
Re: How to use dataFromCSV
[Re: anissyo]
#485949
05/14/22 13:19
05/14/22 13:19
|
Joined: Mar 2021
Posts: 42 Casablanca, Morocco
anissyo
OP
Newbie
|
OP
Newbie
Joined: Mar 2021
Posts: 42
Casablanca, Morocco
|
ok i will try, i found this line here in an example in documentation : int Records = dataParse(1,Format,"History\\BTCEUR.csv");
the only thing I am not understanding is the Format argument, what should I do in Format in my case ?? Let's say for example that the CSV contains one line: "AAA;BBB;CCC" how to get this value from within the CSV ?? what format should I use ??
Thanks a lot my friend =)
Last edited by anissyo; 05/14/22 13:25.
|
|
|
|