Gamestudio Links
Zorro Links
Newest Posts
New Zorro version 1.83
by jcl
Today at 16:24
Unfreed in -diag
by 3run
Today at 10:30
About STRING* and char
by 20BN
Today at 09:40
I need help
by evangelos
Today at 02:37
Draw stuff from other thread
by Superku
Yesterday at 22:00
Optimize Stop with multi Asset strategy
by Dalla
Yesterday at 21:48
cloth ?
by 3run
Yesterday at 20:48
AUM Magazine
Latest Screens
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Forgotten Tales - Demo version
RPG PARTY
Who's Online
17 registered (FirasTaji, AndrewAMD, Cerve, 3run, easyX, alibaba, jenGs, 4 invisible), 483 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
FirasTaji, zentrader, Fenry, DJ_Algo, tang
18005 Registered Users
Topic Options
Rate This Topic
#473479 - 07/12/18 21:55 Export technical indicators to CSV
Yop127 Offline
Newbie

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()
{
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

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

Chief Engineer

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

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

Registered: 09/18/17
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]));



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

Top



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

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