FRAMA
- globaltrader
- Autor témy
Menej
Viac
- Príspevky: 3
02 sep 2010 23:55 #215
od globaltrader
FRAMA was created by globaltrader
Hi,
In the FRAMA file that I downloaded from you on several occasions D drops below 1 and on 30 Jan 2006 it drops as low as .24
D must range between 1 and 2 so are the readings below 1 due to an error in your formula or can they be fixed simply by setting a minimum reading of 1 for the few occasions that it drops below?
Thanks
Fred
In the FRAMA file that I downloaded from you on several occasions D drops below 1 and on 30 Jan 2006 it drops as low as .24
D must range between 1 and 2 so are the readings below 1 due to an error in your formula or can they be fixed simply by setting a minimum reading of 1 for the few occasions that it drops below?
Thanks
Fred
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
- globaltrader
- Autor témy
Menej
Viac
- Príspevky: 3
03 sep 2010 00:10 #216
od globaltrader
Replied by globaltrader on topic FRAMA
I see where your error is:
{*************************************************
FRAMA
By John Ehlers
**************************************************}
Inputs: Price((H+L)/2),
N(16);
{N must be an even number}
Vars: count(0),
N1(0),
N2(0),
N3(0),
HH(0),
LL(0),
Dimen(0),
alpha(0),
Filt(0);
N3 = (Highest(High, N) - Lowest(Low, N)) / N;
HH = High;
LL = Low;
For count = 0 to N / 2 - 1 begin
If High[count] > HH then HH = High[count];
If Low[count] < LL then LL = Low[count];
End;
N1 = (HH - LL) / (N / 2);
HH = High[N / 2];
LL = Low[N / 2];
For count = N/2 to N - 1 begin
If High[count] > HH then HH = High[count];
If Low[count] < LL then LL = Low[count];
End;
N2 = (HH - LL) / (N / 2);
If N1 > 0 and N2 > 0 and N3 > 0 then Dimen = (Log(N1 + N2) - Log(N3)) / Log(2);
alpha = ExpValue(-4.6*(Dimen - 1));
If alpha < .01 then alpha = .01;
If alpha > 1 then alpha = 1;
Filt = alpha*Price + (1 - alpha)*Filt[1];
If CurrentBar < N + 1 then Filt = Price;
Plot1(Filt);
You didn't force alpha into a .01 to 1 range. Check your spreadsheet but I think you need to change this because when D is .24 alpha jumps to 33.53 on your sheet which causes all kinds of problems.
Let me know what you find.
Fred
{*************************************************
FRAMA
By John Ehlers
**************************************************}
Inputs: Price((H+L)/2),
N(16);
{N must be an even number}
Vars: count(0),
N1(0),
N2(0),
N3(0),
HH(0),
LL(0),
Dimen(0),
alpha(0),
Filt(0);
N3 = (Highest(High, N) - Lowest(Low, N)) / N;
HH = High;
LL = Low;
For count = 0 to N / 2 - 1 begin
If High[count] > HH then HH = High[count];
If Low[count] < LL then LL = Low[count];
End;
N1 = (HH - LL) / (N / 2);
HH = High[N / 2];
LL = Low[N / 2];
For count = N/2 to N - 1 begin
If High[count] > HH then HH = High[count];
If Low[count] < LL then LL = Low[count];
End;
N2 = (HH - LL) / (N / 2);
If N1 > 0 and N2 > 0 and N3 > 0 then Dimen = (Log(N1 + N2) - Log(N3)) / Log(2);
alpha = ExpValue(-4.6*(Dimen - 1));
If alpha < .01 then alpha = .01;
If alpha > 1 then alpha = 1;
Filt = alpha*Price + (1 - alpha)*Filt[1];
If CurrentBar < N + 1 then Filt = Price;
Plot1(Filt);
You didn't force alpha into a .01 to 1 range. Check your spreadsheet but I think you need to change this because when D is .24 alpha jumps to 33.53 on your sheet which causes all kinds of problems.
Let me know what you find.
Fred
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
- globaltrader
- Autor témy
Menej
Viac
- Príspevky: 3
03 sep 2010 00:38 #217
od globaltrader
Replied by globaltrader on topic FRAMA
What is the point of column P and Q on your sheet? Why not work straight from Alpha?
www.mesasoftware.com/Papers/FRAMA.pdf
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
- Admin
Menej
Viac
- Príspevky: 112
- Admin
Menej
Viac
- Príspevky: 112
03 sep 2010 13:14 #219
od Admin
Replied by Admin on topic FRAMA
Téma vyriešená 3.9.2010 - Solved.
Pre tých, ktorí by sa zaujímali o tú istú otázku v budúcnosti, odpoveď je nasledovná (komunikácia prebehla v AJ):
As for your question to the Frama, the solution is quite simple.
'D' can occasionally jump bellow 1 or above 2 what makes Alpha readings too high or low. You can read about it in the Ehlers article:
When D=1, the exponent is zero – which means that Alpha = 1.
On the other hand Alpha = 0.01 when D=2
If alpha < .01 then alpha = .01;
If alpha > 1 then alpha = 1;
As you can see, Ehlers himself knows that alpha can be lower than 0.01 or higher than 1. That can happen when D is bellow 1 or above 2.
The solution is either to force the D to be in the range of 1.0 to 2.0, or to force Alpha to be in the range of 0.1 to 1. Both solutions make the same result. Ehlers himself recommends to force the Alpha to be in the interval 0.01 - 1
So, you can either change the 'D' formula in the N8 cell
from: =(LOG10(K8+L8)-LOG10(M8))/LOG10(2)
to: =MAX(1;(LOG10(K8+L8)-LOG10(M8))/LOG10(2))
or to change the Alpha formula in the O8 cell
from: =EXP(-1*(W$5)*(N8-1))
to: =IF(EXP(-1*(W$5)*(N8-1))<0,01;0,01;IF(EXP(-1*(W$5)*(N8-1))>1;1;EXP(-1*(W$5)*(N8-1))))
The reason why I don't like to use any such adaptations of original 'D' or Alpha readings is that when such extreme numbers occure it means something. The market is not moving as usual or generally there has been a strange change in the data (e.g. N1 value MAX-MIN suddenly dropped). That makes me to think about it and to be more cautious. But such readings are quite rare. If you need these values to be just according to John Ehlers, I'm sending you a new file where both these changes are made.
As for your question to P and Q columns. They were integrated into the sheet just for information purposes only. In the P column you can see the number of days that are used for calculation so you see when Frama is very fast and when it is very slow. Q column is a check sum. The most important value is FRAMA itself in the dark green column.
Pre tých, ktorí by sa zaujímali o tú istú otázku v budúcnosti, odpoveď je nasledovná (komunikácia prebehla v AJ):
As for your question to the Frama, the solution is quite simple.
'D' can occasionally jump bellow 1 or above 2 what makes Alpha readings too high or low. You can read about it in the Ehlers article:
When D=1, the exponent is zero – which means that Alpha = 1.
On the other hand Alpha = 0.01 when D=2
If alpha < .01 then alpha = .01;
If alpha > 1 then alpha = 1;
As you can see, Ehlers himself knows that alpha can be lower than 0.01 or higher than 1. That can happen when D is bellow 1 or above 2.
The solution is either to force the D to be in the range of 1.0 to 2.0, or to force Alpha to be in the range of 0.1 to 1. Both solutions make the same result. Ehlers himself recommends to force the Alpha to be in the interval 0.01 - 1
So, you can either change the 'D' formula in the N8 cell
from: =(LOG10(K8+L8)-LOG10(M8))/LOG10(2)
to: =MAX(1;(LOG10(K8+L8)-LOG10(M8))/LOG10(2))
or to change the Alpha formula in the O8 cell
from: =EXP(-1*(W$5)*(N8-1))
to: =IF(EXP(-1*(W$5)*(N8-1))<0,01;0,01;IF(EXP(-1*(W$5)*(N8-1))>1;1;EXP(-1*(W$5)*(N8-1))))
The reason why I don't like to use any such adaptations of original 'D' or Alpha readings is that when such extreme numbers occure it means something. The market is not moving as usual or generally there has been a strange change in the data (e.g. N1 value MAX-MIN suddenly dropped). That makes me to think about it and to be more cautious. But such readings are quite rare. If you need these values to be just according to John Ehlers, I'm sending you a new file where both these changes are made.
As for your question to P and Q columns. They were integrated into the sheet just for information purposes only. In the P column you can see the number of days that are used for calculation so you see when Frama is very fast and when it is very slow. Q column is a check sum. The most important value is FRAMA itself in the dark green column.
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.