I am trying to create signal with Hilbert Trendline with the following code:
Code

function run() 
{
	set(LOGFILE);
	LookBack = 105;
	StartDate = 2019;
	EndDate = 2022;
	
	vars Prices = series(price(0));
	vars TrendMode = series(HTTrendMode(Prices));
	vars WeightedMA = series(WMA(Prices, 4));
	vars ITrend = series(HTTrendline(Prices));
	vars SineWave = series(HTSine(Prices));
	
  
  if(TrendMode == 1){
	  if(crossOver(WeightedMA, ITrend)){
		  enterLong();
	  } else if(crossUnder(WeightedMA, ITrend)){
		  enterShort();
	  }  
  }
}


Zorro printed out the log below, which seems to indicate no error:
Code
Trend compiling............
Test: Trend EUR/USD 2019..2022


However, the result chart has no equity curve on it. I have checked the parameters for the functions but I am not able to find any mistakes.

Attached Files
1.png (19 downloads)
Last edited by vicknick; 04/28/23 07:26.