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
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,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

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