Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, exile, Ayumi), 1,085 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ERROR 041 #438269
03/11/14 10:03
03/11/14 10:03
Joined: Mar 2014
Posts: 13
B
Bernardo Offline OP
Newbie
Bernardo  Offline OP
Newbie
B

Joined: Mar 2014
Posts: 13
Hi,
as a newbie in trading I tested this script:

Code:
function run()
{
	StartDate = 20130303;
	EndDate = 20140303;	
	BarPeriod = 240;
	printf ("\n Std, Min, Datum: %i:%i / %i.%i.%i",hour(),minute(),day(),month(),year());	
	string name;
	while(name = loop("AUD/USD","EUR/USD","EUR/CHF","GBP/USD","GER30","NAS100",
	"SPX500","UK100","US30","NZD/USD","USD/CAD","USD/CHF","USD/JPY",
	"USOil","XAG/USD","XAU/USD"))
	{
		asset (name);
		vars Price = series(price());
		vars Trend = series(LowPass(Price,1000));
		//		printf("\n Asset = %s",name);
		if(valley(Trend))
		{
			printf("\n Valley: %s",name);
			return;
			}else if(peak(Trend)){
			printf("\n Peak: %s",name);
			return;			
		}
	}
}




The output was:
Allassets_series_test compiling...............
Std, Min, Datum: 0:0 / 0.0.0 assets........
Subscribe asset NZD/USD
FXCM.dll => FXCM interface opened
Login FXCM.... at UTC 11.03. 07:54.......
Logout.. ok
BackTest: Allassets_series_test portfolio 2013..2014
Std, Min, Datum: 4:0 / 12.2.2013
Std, Min, Datum: 8:0 / 12.2.2013
Std, Min, Datum: 12:0 / 12.2.2013
Valley: USOil
Cancelled


Zorro stopped with Error 041 after printing "Valley: USOil".
What is my Error?

Thanks for all suggestions!

Greets
Bernardo

Re: ERROR 041 [Re: Bernardo] #438274
03/11/14 12:38
03/11/14 12:38
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Originally Posted By: The Mighty Manual
Error 041: Inconsistent series calls

The number or order of series calls in the script is different to the previous run. Make sure that the number and order of of series calls does not change; don't call them dependent on if conditions.


As soon as one asset got a valley or peak, you're aborting the function without running the other assets. This will certainly cause a different number of series calls in every run.

Re: ERROR 041 [Re: jcl] #438276
03/11/14 13:25
03/11/14 13:25
Joined: Mar 2014
Posts: 13
B
Bernardo Offline OP
Newbie
Bernardo  Offline OP
Newbie
B

Joined: Mar 2014
Posts: 13
Oops, I read this but I didn't understand.

Thanks for your pacience.

Re: ERROR 041 [Re: Bernardo] #438297
03/11/14 17:30
03/11/14 17:30
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
What I meant was: remove your "return" statements! They are wrong here, and will abort the function and thus break your code.

Re: ERROR 041 [Re: jcl] #438318
03/11/14 20:54
03/11/14 20:54
Joined: Mar 2014
Posts: 13
B
Bernardo Offline OP
Newbie
Bernardo  Offline OP
Newbie
B

Joined: Mar 2014
Posts: 13
Oh, misunderstanding, I had already understood your posting but not the "Mighty Manual" blush .
This part is working well now, I fear further errors will occure ...

Thanks so much wink


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1