Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (vicknick, howardR, sleakz), 674 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
history data for spy not work ? #487571
06/07/23 23:01
06/07/23 23:01
Joined: Jun 2016
Posts: 49
F
faustf Offline OP
Newbie
faustf  Offline OP
Newbie
F

Joined: Jun 2016
Posts: 49
hi i download a history spx500 http://opserver.de/down/history_SPY.zip uncompress and insert the data inside the forlder \Zorro\History after i create a simple script
function run()
{
set(PARAMETERS+LOGFILE);
BarPeriod = 1440; // Periodo giornaliero

if(day() == MONDAY && hour() == 23 && minute() == 58)
{
// Calcola l'RSI a 2 periodi
vars Price = series(price());
vars RSI2 = series(RSI(Price, 2));

if(RSI2[0] < 30)
{
enterLong(1);
printf("Entered long position");
}
}

if(day() == WEDNESDAY && hour() == 0 && minute() == 5)
{
exitLong(1);
printf("Exited long position");
}
}

i choice in script my script and spx500 test but tell me

spx compiling...........
Error 047: SPX500 no 2018 history (History\SPX500.t6)
Error 047: SPX500 2018..2023 no data
Error 047: No SPX500 prices

Re: history data for spy not work ? [Re: faustf] #487572
06/08/23 02:42
06/08/23 02:42
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Probably because you downloaded SPY data instead of SPX500 data.

Re: history data for spy not work ? [Re: faustf] #487573
06/08/23 08:29
06/08/23 08:29
Joined: Jun 2016
Posts: 49
F
faustf Offline OP
Newbie
faustf  Offline OP
Newbie
F

Joined: Jun 2016
Posts: 49
but why if i insert in history spy when i open a combobox not appear , and i saw only spx500 ?

Re: history data for spy not work ? [Re: faustf] #487575
06/08/23 09:14
06/08/23 09:14
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
You need to adjust your asset list file, see https://zorro-project.com/manual/en/account.htm

Re: history data for spy not work ? [Re: faustf] #487579
06/08/23 20:24
06/08/23 20:24
Joined: Jun 2016
Posts: 49
F
faustf Offline OP
Newbie
faustf  Offline OP
Newbie
F

Joined: Jun 2016
Posts: 49
thanks for rply i add this line SPY,2838,0.5,0.0645,-0.1439,1,0.1,-1,0,0.1,0,SPY/USD at file assefix.csv now appear spy i run my script
function run()
{
set(PARAMETERS+LOGFILE);
BarPeriod = 1440; // Periodo giornaliero

if(day() == MONDAY && hour() == 23 && minute() == 58)
{
// Calcola l'RSI a 2 periodi
vars Price = series(price());
vars RSI2 = series(RSI(Price, 2));

if(RSI2[0] < 30)
{
enterLong(1);
printf("Entered long position");
}
}

if(day() == WEDNESDAY && hour() == 0 && minute() == 5)
{
exitLong(1);
printf("Exited long position");
}
}


but after run i click over button result but showme only a chart with out open and close operation not have simulated nothing , anyone know why ?? thanks again

Re: history data for spy not work ? [Re: faustf] #487580
06/08/23 20:48
06/08/23 20:48
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
run() is only called once per day at BarPeriod 1440, yet you’re checking for entry and exit conditions as if it’s an intraday script. Eliminate those conditions.

Re: history data for spy not work ? [Re: faustf] #487584
06/09/23 20:29
06/09/23 20:29
Joined: Jun 2016
Posts: 49
F
faustf Offline OP
Newbie
faustf  Offline OP
Newbie
F

Joined: Jun 2016
Posts: 49
i remove function run but i have this error

Zorro 2.48.1
(c) oP group Germany 2022


spx compiling...........
Test: spx SPY 2018..2023


spx compiling...........
Error 061: No main or run function!

Re: history data for spy not work ? [Re: faustf] #487586
06/10/23 17:58
06/10/23 17:58
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
Because you removed the run() function for whatever reason.

Re: history data for spy not work ? [Re: faustf] #487587
06/11/23 21:34
06/11/23 21:34
Joined: Jun 2016
Posts: 49
F
faustf Offline OP
Newbie
faustf  Offline OP
Newbie
F

Joined: Jun 2016
Posts: 49
ops sorry i eliminate bar period
function run()
{
set(PARAMETERS+LOGFILE);
//BarPeriod = 1440; // Periodo giornaliero

if(day() == MONDAY && hour() == 23 && minute() == 58)
{
// Calcola l'RSI a 2 periodi
vars Price = series(price());
vars RSI2 = series(RSI(Price, 2));

if(RSI2[0] < 30)
{
enterLong(1);
printf("Entered long position");
}
}

if(day() == WEDNESDAY && hour() == 0 && minute() == 5)
{
exitLong(1);
printf("Exited long position");
}
}


but return me thesame result .... only the chart

Re: history data for spy not work ? [Re: faustf] #487588
06/12/23 00:09
06/12/23 00:09
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
You disabled BarPeriod, so that means you're using 1 hour bars by default. However, you're checking if 'minute() == 58', so that won't work with this BarPeriod.
Andrew already wrote this.

https://zorro-project.com/manual/en/barperiod.htm

Last edited by Grant; 06/12/23 09:36.
Page 1 of 4 1 2 3 4

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1