Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (RealSerious3D, AndrewAMD, chsmac85, dr_panther, TedMar), 942 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Is the code/formulae for the various functions available? #411099
11/13/12 10:05
11/13/12 10:05
Joined: Nov 2012
Posts: 8
Singapore
discrete Offline OP
Newbie
discrete  Offline OP
Newbie

Joined: Nov 2012
Posts: 8
Singapore
Such as valley, peak, LowPass, HighPass etc?

I'm reading through the help manual but many of the explanations are quite brief. Or if you could point me to the folder where these are kept that would be great too.

Re: Is the code/formulae for the various functions available? [Re: discrete] #411104
11/13/12 10:29
11/13/12 10:29
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The source code of most indicators can be found in include\indicators.c.

Here's peak and valley:

Code:
BOOL peak(var* a) { return (a[2] < a[1]) && (a[1] > a[0]); }
BOOL valley(var* a) { return (a[2] > a[1]) && (a[1] < a[0]); }


Re: Is the code/formulae for the various functions available? [Re: jcl] #411111
11/13/12 10:49
11/13/12 10:49
Joined: Nov 2012
Posts: 8
Singapore
discrete Offline OP
Newbie
discrete  Offline OP
Newbie

Joined: Nov 2012
Posts: 8
Singapore
I see, got it, and thanks for ur fast response!

Re: Is the code/formulae for the various functions available? [Re: discrete] #412033
11/22/12 02:14
11/22/12 02:14
Joined: Nov 2012
Posts: 19
Texas, US
D
deweymcg Offline
Newbie
deweymcg  Offline
Newbie
D

Joined: Nov 2012
Posts: 19
Texas, US
I looked there and did not see LowPass

Re: Is the code/formulae for the various functions available? [Re: deweymcg] #412042
11/22/12 08:09
11/22/12 08:09
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Not all indicators are open source, some are under license. But here's the Lowpass filter:

Code:
var LowPass(var *data,int period)
{
	var* LP = series(*data,3);
	var a = 2./(period+1);
	var a2 = a*a;
	return LP[0] = (a-a2/4)*data[0]
		+ 0.5*a2*data[1]
		- (a-0.75*a2)*data[2]
		+ 2*(1.-a)*LP[1]
		- (1.-a)*(1.-a)*LP[2];
}


Re: Is the code/formulae for the various functions available? [Re: jcl] #412053
11/22/12 11:00
11/22/12 11:00
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
You can also use my code-editor ( http://www.dev-software.com/liteEdit_111.exe ) to check the code behind those functions.. Just rightclick on any function and press "go to definition", and you'll see the code - as long as it is deplyed as c-script and not as an closed source dll file.

Re: Is the code/formulae for the various functions available? [Re: TechMuc] #412106
11/22/12 17:40
11/22/12 17:40
Joined: Nov 2012
Posts: 19
Texas, US
D
deweymcg Offline
Newbie
deweymcg  Offline
Newbie
D

Joined: Nov 2012
Posts: 19
Texas, US
Awesome. You guys are terrific. Now I have to see if I can figure out how to convert this to MQL


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1