LowPass value as trading condition, but getting Error 041

Posted By: Isembold

LowPass value as trading condition, but getting Error 041 - 07/27/17 13:15

Hello everyone.

I'm sorry if this question have been asked before, but I couldn't find the answer. I'm a newbie in systematic trading, and I've chosen Zorro to start with because I already have some C programming knowledge.

I want to test a simple strategy, it's buying the candle next to a Homing Pigeon pattern and selling at the next candle, but only if we're trending up.
I decided to use a low pass filter to check the trend.
I know I'm not doing it properly, so my question is a bit more extensive.

I understood that a function that internally creates a series can not be in any order (is this correct?). But then, I don't know how should I use it if I need to take the return of that mentioned function in a loop.

Could someone tell me how should I implement(or fix my script) this?

I leave my script both attached and quoted:
Code:
function run()
{
	vars Price = series(price());
	
	StartDate = 2012;
	EndDate = 2014; 
	BarPeriod = 1440;
	BarZone = WET;
	Weekend = 1;
	LookBack = 11;
	
	
	while(price() > LowPass(Price,10))
		LifeTime = 1;
		if(CDLHomingPigeon()>0)
		{
			enterLong();
		}
	
	
}




Thank you very much in advance.

Attached File
InsideDayUptrend.c  (4 downloads)
Posted By: jcl

Re: LowPass value as trading condition, but getting Error 041 - 07/27/17 15:16

I would replace while with if, and also try to find my missing brackets.
Posted By: Isembold

Re: LowPass value as trading condition, but getting Error 041 - 07/27/17 18:37

I feel a bit shamed for having made such stupid mistake, replacing the while with the if fixed it.

A bit off topic, but would like to thank you for writing Financial Hacker, really liked every post.

Will keep reading you and improving my Zorro scripts.

Thank you very much jcl.
© 2024 lite-C Forums