#
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Home
Forex Forum
+ Add Script
Metastock
Expert Advisors
Explorations
Indicators
Trading Systems
Metatrader
MQL Experts
MQL Indicators
MQ4 Experts
MQ4 Indicators
MQ4 Scripts
Tradestation
Functions
Indicators
PaintBars
ShowMe
Trading Systems
Amibroker
Commentaries
Explorations
Functions
Indicators
Trading Systems
Contact us
Newsletter
Group: Metatrader MQL Indicators
Title: Fisher - Colored histogram
Description:
Fisher - Colored histogram
/*[[ Name := Fisher Separate Window := Yes First Color := Lime First Draw Type := Histogram First Symbol := 217 Use Second Data := Yes Second Color := Red Second Draw Type := Histogram Second Symbol := 218 ]]*/ //******** Parameters ******** Input : nBars(10), Mark(1); //******** Variables ******** Variables : bar(0), prevbars(0), start(0), cs(0), prevcs(0); Variables : P(0), Value(0), Fish(0), MaxH(0), MinL(0); Variables : Value1(0), Fish1(0), Fish2(0), i(0), pFish(0); //Initialisation setloopcount(0); cs=nBars+Mark; //checksum used to see if parameters have been changed if cs=prevcs then start=Bars-prevbars //params haven't changed only need to calculate new bar else start=-1; prevbars = Bars; prevcs = cs; if start=1 | start=0 then bar+=start else //if number of new bars is >1 or <0 then re-calculatge entire chart { bar = Bars; For i=1 to nBars { bar-=1; SetIndexValue(bar,0); }; Value=0; Fish=0; Fish1=0; }; While bar>1 {//per bar jobs bar -=1; //Fish formulae courtesy of:- //http://www.linnsoft.com/tour/techind/fish.htm Value1 = Value; Fish2 = Fish1; Fish1 = Fish; MaxH=H[Highest(MODE_HIGH,bar+nBars-1,nBars)]; MinL=L[Lowest(MODE_LOW,bar+nBars-1,nBars)]; //MaxH=H[Highest(MODE_HIGH,bar+nBars,nBars)]; //MinL=L[Lowest(MODE_LOW,bar+nBars,nBars)]; P=(H[bar]+L[bar])/2; Value = 0.33*2*((P-MinL)/(MaxH-MinL)-0.5) + 0.67*Value1; Value=Min(Max(Value,-0.999),0.999); //bounds checking Fish = 0.5*Log((1+Value)/(1-Value))+0.5*Fish1; If Fish > pFish Then SetIndexValue(bar, Fish); If Fish < pFish Then SetIndexValue2(bar, Fish); If Mark>0 Then{ If Fish<-1 & Fish>Fish1 & Fish1<=Fish2 Then SetArrow(Time[bar],L[bar],159,LIME); If Fish>1 & Fish
=Fish2 Then SetArrow(Time[bar],H[bar],159,RED); } Else{ DelArrow(Time[bar],L[bar]); DelArrow(Time[bar],H[bar]); }; pFish = Fish; }; //per tick jobs //- we don't have any //End;
Author/Source:
?
Forex Directory
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact