Page 1 of 1

extract data from chart

Posted: Tue Jun 27, 2017 4:16 pm
by rlygangesh
Hi all
as we know that we can extract indicator value in excel from wave 59 using output indicator to ASCII.
but can be extract astro/cycle data(eg planatary harmonic index) with same way?

if yes than please help

Re: extract data from chart

Posted: Tue Jun 27, 2017 7:19 pm
by earik
You can write a script to do that, since QScript has access to all the ephemeris data using the astro(...) function. You can use that in conjunction with file_write(...) to output whatever you need to a text file. It would look something like this:

Code: Select all

input:filename("c:\my_astro_data.txt");

if (barnum == barsback) {
   file_delete(filename); # clear the file if it already exists
}

# get the moons position - see qscript help for instructions on this function
moon = astro(year, month, day, time, astro_moon, true, astro_long, true);

# write the data for this bar to the file
file_write(filename,year," ",month," ",day," ",time," ",moon);

# plot a line on the chart so you can see when the indicator is finished
plot1 = close;
Hope that helps!

Regards,

Earik