Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Does COMMONSTART flag work? #479852
05/01/20 08:30
05/01/20 08:30
Joined: Jun 2018
Posts: 3
G
ganimedes Offline OP
Guest
ganimedes  Offline OP
Guest
G

Joined: Jun 2018
Posts: 3
I have a large list of US stocks.

I would need the date of the first day being publicly listed for each of them (example PTON: 2019-09-26) so I coded a simple script that prints the date of the first bar of each symbol.

I set off the flag COMMONSTART but it doesnt work, all symbols are processed after the "youngest" stock starts.

Here is the script:

var date_ini = 20180101;
var date_end = 20200422;

function check_bar() {
int second_day_listed_and_later = AssetInt[0];

if(second_day_listed_and_later==0){
print(TO_CSV,"\n%d;%s",year() *10000 + month() * 100 + day(),Asset);
}
AssetInt[0] = 1;
}


function run()
{
StartDate = date_ini;
EndDate = date_end;
string name;

if(is(INITRUN)) {
set(COMMONSTART|OFF);

assetList("Assets_screening_mix.csv");
printf("\nNumAssetsListed: %d", NumAssetsListed);
}
while(asset(loop(Assets))) {
check_bar();
}

}

Any idea?

This also affect to training. I need to list the youngest stocks at the end of the assets list CSV in order to get coherent results.

Re: Does COMMONSTART flag work? [Re: ganimedes] #479853
05/01/20 11:57
05/01/20 11:57
Joined: Feb 2017
Posts: 1,729
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,729
Chicago
Quote
I set off the flag COMMONSTART but it doesnt work, all symbols are processed after the "youngest" stock starts.

Did you mean "oldest" (first stock to exist)? If you meant "youngest" (stock did not exist until recently), COMMONSTART is behaving exactly as described in the manual. After all, in order to have a "common start", all stocks must exist.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1