Gamestudio Links
Zorro Links
Newest Posts
Windows permission issues
by HellThunder
Today at 21:51
CSVToHistory.c
by Dalla
Today at 20:42
Position Close not possible
by MatPed
Today at 18:49
Options trading questions
by Zheka
Today at 17:36
Published Gamestudio Games?
by jumpman
Today at 08:05
New Zorro version 1.88
by DdlV
Yesterday at 20:32
Possible to extend assetHistory with own source?
by jcl
Yesterday at 16:32
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
17 registered (Jason_Rogers, alibaba, dmac, AndrewAMD, HellThunder, Dalla, jumpman, 3run, 3 invisible), 505 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
cepturion, Mon3y, vincitytaymo, just, XJohnny_Hoffmann
18057 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 Offline

Chief Engineer

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