Laguerre_v6

Author: Copyright � 2007, SanSey
Laguerre_v6
0 Views
0 Downloads
0 Favorites
Laguerre_v6
//+------------------------------------------------------------------+
//|                                                      Collaps.mq4 |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2007, SanSey"
#property link      "http://www.forexchat.ru"
#property library

double LaGuerre(double gamma, int shift)
{
	double RSI;
	double L0[100];
	double L1[100];
	double L2[100];
	double L3[100];
	double CU, CD;

	for (int i=shift+99; i>=shift; i--)
	{
		L0[i] = (1.0 - gamma)*Close[i] + gamma*L0[i+1];
		L1[i] = -gamma*L0[i] + L0[i+1] + gamma*L1[i+1];
		L2[i] = -gamma*L1[i] + L1[i+1] + gamma*L2[i+1];
		L3[i] = -gamma*L2[i] + L2[i+1] + gamma*L3[i+1];

		CU = 0; CD = 0;
		if (L0[i]>=L1[i]) CU=   L0[i]-L1[i]; else CD=L1[i]-L0[i];
		if (L1[i]>=L2[i]) CU=CU+L1[i]-L2[i]; else CD=CD+L2[i]-L1[i];
		if (L2[i]>=L3[i]) CU=CU+L2[i]-L3[i]; else CD=CD+L3[i]-L2[i];
		if (CU + CD != 0)	RSI = CU/(CU+CD);
	}
   return(RSI);
}  

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---