external data in trade logic

Posted By: maurice1973

external data in trade logic - 03/13/18 12:41

hi all, í am having some problems with utilising external data, hope someone can help out;

i figured out on this forum how to succesfully parse csv data,
but cannot call it succesfully in my script.

my data consists of dates + 1 column containing a value

string Format = "%Y-%m-%d %H:%M:%S,f";
int RecordsEUR1H = dataParse(1,Format,example.csv);

specifically, my questions are:

1.how do i call todays column value to incorporate in my logic, for example:
if (todays column value == 100)
enterLong();

2.how do put the column values in an array/series, so i can calculate a moving average?

i know the function dataFind has to be used, but how?

best, Maurice
Posted By: jcl

Re: external data in trade logic - 03/13/18 17:18

Yes, it's dataFind. Look into contract.c: There is the code of dataFromCSV that gets an indicator out of external data.
© 2024 lite-C Forums