Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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,699
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

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