Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Export technical indicators to CSV #473479
07/12/18 19:55
07/12/18 19:55
Joined: Sep 2017
Posts: 13
Y
Yop127 Offline OP
Newbie
Yop127  Offline OP
Newbie
Y

Joined: Sep 2017
Posts: 13
Hello all,
I am trying to do something extremely simple: create a CSV with Date, open, high, low, close, RSI columns. However, I am new to Zorro, and cannot quite manage it.
Here is what I have currently:

function run()
{
set(LOGFILE|PLOTNOW);
NumYears = 1;

vars Prices = series(price());
vars Closes = series(priceClose());


vars Price = series(price());
vars Closes = series(priceClose());
file_append("C:JC.csv",RSI(Closes,3,2,100));
}


This does not work. Any help would be deeply appreciated!
Thanks in advance

Re: Export technical indicators to CSV [Re: Yop127] #473483
07/13/18 09:29
07/13/18 09:29
Joined: Jul 2000
Posts: 28,029
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,029
Frankfurt
This does indeed not work. The simplest way is print(TO_CSV,...) with a format string and all variables that you want to export.

Re: Export technical indicators to CSV [Re: jcl] #473490
07/13/18 15:46
07/13/18 15:46
Joined: Sep 2017
Posts: 13
Y
Yop127 Offline OP
Newbie
Yop127  Offline OP
Newbie
Y

Joined: Sep 2017
Posts: 13
In case someone else has the same issue, this piece of code does the trick.

Code:
function run()
{
	StartDate = 20100101;
	BarPeriod = 1440;

  vars Close = series(priceClose());
  vars SMA100 = series(SMA(Close,100));
  vars SMA30 = series(SMA(Close,30));

  
  string Format = "n%04i-%02i-%02i %02i:%02i, %.10f, %.10f";
	
	
file_append("JC2.csv",strf(Format,year(),month(),day(),hour(),minute(), Close[0], SMA30[0]));


Last edited by Yop127; 07/14/18 06:10.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1