crossOver() Pointer Expected Error

Posted By: vicknick

crossOver() Pointer Expected Error - 04/28/23 04:47

I have the following code that goes long or short when LeadSine crosses over or under SineWave.

Code
function run() 
{
	set(LOGFILE);
	asset("EUR/USD");
	
	vars Prices = series(price());
	vars SineWave = series(HTSine(Prices));
  
	  if(crossOver(rLeadSine, rSine)){
		  enterLong();
	  } else if(crossUnder(rLeadSine, rSine)){
		  enterShort();
	  }  

	  
}


However, zorro returns the following error:
Code
crossOver(): Pointer expected
< 	  if(crossOver(rLeadSine, rSine)){
 >.


Is it because the rLeadSine and rSine are not series? Not sure how to proceed with this.
Posted By: AndrewAMD

Re: crossOver() Pointer Expected Error - 04/28/23 12:46

Yes, it’s because they are not series. crossOver() requires a vars, but you only supplied a var and a var.

So make a vars that is a series, like you already did in your code, and feed it to the function.
Posted By: vicknick

Re: crossOver() Pointer Expected Error - 04/29/23 03:14

Thanks! That seems to work now
© 2024 lite-C Forums