#
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 MQ4 Indicators
Title: Ergodic Indicator
Description:
Ergodic Indicator
//+------------------------------------------------------------------+ //| Danny Feng Ergodic.mq4 | //+------------------------------------------------------------------+ #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Yellow #property indicator_color2 Red //---- input parameters extern int r=2; extern int s=5; extern int u=8; extern int smooth=2; //---- buffers double ErgBuffer[]; double ema_ErgBuffer[]; double Price_Delta1_Buffer[]; double Price_Delta2_Buffer[]; double s_ema1_Buffer[]; double s_ema2_Buffer[]; double u_ema1_Buffer[]; double u_ema2_Buffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- additional buffers are used for counting. IndicatorBuffers(8); SetIndexBuffer(0,ema_ErgBuffer); SetIndexBuffer(1,ErgBuffer); SetIndexBuffer(2,Price_Delta1_Buffer); SetIndexBuffer(3,Price_Delta2_Buffer); SetIndexBuffer(4,s_ema1_Buffer); SetIndexBuffer(5,s_ema2_Buffer); SetIndexBuffer(6,u_ema1_Buffer); SetIndexBuffer(7,u_ema2_Buffer); //---- indicator lines SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_HISTOGRAM); //---- name for DataWindow and indicator subwindow label short_name="Ergodic"; IndicatorShortName(short_name); SetIndexLabel(0,short_name); //---- SetIndexDrawBegin(0,r+s+u+smooth); SetIndexDrawBegin(1,r+s+u+smooth); //---- return(0); } //+------------------------------------------------------------------+ //| True Strength Index | //+------------------------------------------------------------------+ int start() { int i,limit; double mean1, mean2; int counted_bars=IndicatorCounted(); if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(i=0; i
Author/Source:
Danny Feng
Forex Directory
|
Free Forex Strategies
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact