Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, monk12, TipmyPip, Quad, aliswee), 1,029 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Assets variable contain invalid asset/symbols #483505
06/07/21 16:18
06/07/21 16:18
Joined: May 2018
Posts: 134
S
SBGuy Offline OP
Member
SBGuy  Offline OP
Member
S

Joined: May 2018
Posts: 134
I've been doing this for the past several years to loop through valid symbols from my assetList files.

for(i=0; Assets[i]; i++) { asset(Assets[i]); }
or
while(loop(Assets)) { asset(Loop1]); }

Recently I noticed that bad symbols in the assetList are replaced with 1 prior valid symbol when Zorro constructs the Assets variable, causing a duplicate entry in Assets. Support thinks I have a coding problem.

Here's the test code:
Code
void run() 
{
	set(PLOTNOW|LOGFILE);
	set(PRELOAD);
	
	StartDate 	= NOW;	

	LookBack = 250;
	SaveMode = 0;
	
	BarPeriod = 1440;	
	BarZone = ET;			
	EndWeek = 52300;				//UTC Time, 2300 to get past DST
	BarOffset=15*60+45;		//3:45PM ET		
	StartMarket = 1000;			//ET Time
	EndMarket = 1600;				//ET Time
	BarMode = BR_WEEKEND + BR_MARKET + BR_LEISURE + BR_SLEEP;
	TickTime = 1*30*1000;
	TockTime = 1*30*1000;
	
	int anum = assetList("Assets-TEST");
	int i;
	
	if (!is(LOOKBACK)) printf("\n");
	
	for(i=0; Assets[i]; i++) 
	{  
		asset(Assets[i]);
		if (!is(LOOKBACK)) printf("[%d/%d]-----[%s] %.2f ------------\n", i, NumAssetsListed, Asset, priceClose());
	}
	
}


Here's the live trade log, OXY is duplicated in the Assets symbol list.
==========================
Load XOM prices.. 26+300 h
Load SLB prices.. 26+300 h
Load OXY prices.. 26+300 h
!BROKERASSET: [APHA] failed... retry
Error 053: APHA unavailable at this time
Load CGC prices.. 26+300 h.
Load RIOT prices.. 26+300 h

....

[302: Mon 21-06-07 16:03] (61.12)
[0/7]-----[XOM] 61.12 ------------
[1/7]-----[SLB] 36.00 ------------
[2/7]-----[OXY] 29.15 ------------
[3/7]-----[OXY] 29.15 ------------ <-------- was supposed to be APHA
[4/7]-----[CGC] 25.61 ------------
[5/7]-----[OSTK] 93.76 ------------
[6/7]-----[RIOT] 28.73 ------------

Re: Assets variable contain invalid asset/symbols [Re: SBGuy] #483506
06/07/21 20:07
06/07/21 20:07
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
Not answering your question, but FYI - EndWeek is in BarZone time.

Re: Assets variable contain invalid asset/symbols [Re: SBGuy] #483508
06/07/21 20:29
06/07/21 20:29
Joined: May 2018
Posts: 134
S
SBGuy Offline OP
Member
SBGuy  Offline OP
Member
S

Joined: May 2018
Posts: 134
Thanks. For a long time it was UTC! I’ve always felt it should’ve been BarZone as well. Glad they fixed it.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1