Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Akow, SBGuy), 1,423 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 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,731
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,731
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