Gamestudio Links
Zorro Links
Newest Posts
New Zorro v1.99.2
by jcl
46 minutes 0 seconds ago
Strategy Development
by AndrewAMD
59 minutes 37 seconds ago
closing profitable trades (stop)
Today at 12:47
Next contest?
by jcl
Yesterday at 15:44
advance decline (ADO) code examples?
by 3dgamelight
12/09/18 19:52
Newbie coding question. HELP Please!
by 3dgamelight
12/09/18 16:28
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14
12/08/18 19:10
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
19 registered (alibaba, ags, Artvin, AndrewAMD, chsmac85, 20BN, CocaCola, Ayumi, 5 invisible), 477 Guests and 12 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
mahomed, bondz, Neil_G, bobby4h, MutilatedDuck
18117 Registered Users
Topic Options
Rate This Topic
#473479 - 07/12/18 21:55 Export technical indicators to CSV
Yop127 Offline

Registered: 09/18/17
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()
NumYears = 1;

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

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

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

#473483 - 07/13/18 11:29 Re: Export technical indicators to CSV [Re: Yop127]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26655
Loc: 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.

#473490 - 07/13/18 17:46 Re: Export technical indicators to CSV [Re: jcl]
Yop127 Offline

Registered: 09/18/17
Posts: 13
In case someone else has the same issue, this piece of code does the trick.

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]));

Edited by Yop127 (07/14/18 08:10)


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at)