Gamestudio Links
Zorro Links
Newest Posts
SGT_FW
by Aku_Aku. 11/30/26 08:19
Removing outliers from files
by JeyKey II. 11/29/26 10:01
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (JeyKey II, TipmyPip, Martin_HH, Aku_Aku), 12,516 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
function call error #487768
09/11/23 07:55
09/11/23 07:55
Joined: Sep 2023
Posts: 18
Freiburg
S
steyr Offline OP
Newbie
steyr  Offline OP
Newbie
S

Joined: Sep 2023
Posts: 18
Freiburg
Hello everyone, I come from the MQL5 community, and I'm puzzled by this compiler error: Error 111 crash in run: run()

Something seems to be wrong with the call to StdDevFunc(), but I can't figure out what it might be. I would greatly appreciate your help.

Code

// Strategy template ///////////////////////

var ExtStdDevPeriod = 14; // Definition der Periodenlänge (können Sie anpassen)

function run() 
{
	var StdDevFunc(vars ,vars , var);
	
	
	BarPeriod = 60;
	set(PARAMETERS|LOGFILE);
	LookBack = 1000;
	if(Train) Detrend = TRADES;
	StartDate = 20130101;
	EndDate = 2023;
	NumWFOCycles = 10;
	
	vars Price = series(price());
        vars Trend = series(MovingAverage(Price,60,EMA));

	vars standardA = series(StdDevFunc(Price,Trend,0));
	
	
	plot("Trend",Trend,0,BLUE);
	plot("stddev",standardA,NEW,BLUE);
	PlotWidth = 800;
	PlotHeight1 = 300;
	
	

}

	var StdDevFunc(vars Preis,vars MAprice, var position)
	{
		 
		 var dTmp = 0.0;
		 var i;
		 for (i = 0; i < ExtStdDevPeriod; i++)
		 {
			  dTmp += pow(Preis[position - i] - MAprice[position], 2);
		 }
		 dTmp = sqrt(dTmp / ExtStdDevPeriod);
		 return dTmp;
	}




Last edited by steyr; 09/11/23 07:56.
Re: function call error [Re: steyr] #487770
09/11/23 10:29
09/11/23 10:29
Joined: Aug 2023
Posts: 19
I
izorro Offline
Newbie
izorro  Offline
Newbie
I

Joined: Aug 2023
Posts: 19
The Troubleshooting Page has some good info.

You can use watch statement to debug and find which line might be causing the problem.

Re: function call error [Re: steyr] #487772
09/11/23 12:24
09/11/23 12:24
Joined: Feb 2017
Posts: 1,839
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,839
Chicago
That's not a compiler error, it compiled just fine. That's a runtime error.

Also, I don't understand why you put your function prototype for StdDevFunc() inside the run() body. Move it to prior. Or just move the actual function above it and remove the prototype.

Re: function call error [Re: steyr] #487783
09/14/23 08:25
09/14/23 08:25
Joined: Sep 2023
Posts: 18
Freiburg
S
steyr Offline OP
Newbie
steyr  Offline OP
Newbie
S

Joined: Sep 2023
Posts: 18
Freiburg
Thank you all!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1