/*
Generated by ex4-to-mq4 decompiler (forex-warez.com) 4.0.509.5
Website: WwW.foR Ex - w a R eZ.cO m
E-mail : An DR E yb BRv @ GM ail .c oM
*/
#property copyright "Copyright ?2006, FX Sniper "
#property link "http://www.metaquotes.net/"
#property indicator_separate_window
#property indicator_minimum 0.0
#property indicator_maximum 100.0
#property indicator_buffers 3
#property indicator_color1 Fuchsia
#property indicator_color2 LightSeaGreen
#property indicator_color3 Black
#property indicator_width1 1
#property indicator_level1 20.0
#property indicator_width2 1
#property indicator_level2 50.0
#property indicator_width3 1
#property indicator_level3 80.0
extern int timeframe1 = 5;
extern int timeframe2 = 15;
extern int timeframe3 = 60;
extern int count = 2800;
double G_ibuf_100[];
double G_ibuf_104[];
double G_ibuf_108[];
int G_shift_112;
int init() {
IndicatorBuffers(3);
SetIndexBuffer(0, G_ibuf_100);
SetIndexBuffer(1, G_ibuf_104);
SetIndexBuffer(2, G_ibuf_108);
SetIndexStyle(0, DRAW_LINE);
SetIndexStyle(1, DRAW_LINE);
SetIndexStyle(2, DRAW_LINE);
IndicatorShortName("wan2009 - ( " + timeframe1 + " , " + timeframe2 + " , " + timeframe3 + " ) ");
return (0);
}
int start() {
int minute_0;
int Li_4;
int shift_8;
int Li_12 = IndicatorCounted();
if (Li_12 > 0) Li_12--;
int Li_16 = Bars - Li_12;
Li_16 = MathMin(Li_16, count);
Li_16 = MathMax(Li_16, 3);
double Ld_20 = 0;
for (int shift_28 = Li_16; shift_28 >= 0; shift_28--) {
if (Period() == timeframe1) G_ibuf_100[shift_28] = iStochastic(NULL, timeframe1, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_28);
else {
if (Period() > timeframe1) G_ibuf_100[shift_28] = EMPTY_VALUE;
else {
minute_0 = TimeMinute(Time[shift_28]);
Li_4 = MathMod(minute_0, timeframe1);
if (Li_4 != 0) {
G_shift_112 = iBarShift(NULL, timeframe1, Time[shift_28] - 60 * Li_4);
if (G_shift_112 == 0) G_ibuf_100[shift_28] = G_ibuf_100[shift_28 + 1];
else {
Ld_20 = iStochastic(NULL, timeframe1, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, G_shift_112 - 1) - iStochastic(NULL, timeframe1, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, G_shift_112);
Ld_20 = Ld_20 * Li_4 / timeframe1;
G_ibuf_100[shift_28] = iStochastic(NULL, timeframe1, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, G_shift_112) + Ld_20;
}
} else {
shift_8 = iBarShift(NULL, timeframe1, Time[shift_28]);
G_ibuf_100[shift_28] = iStochastic(NULL, timeframe1, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_8);
}
}
}
if (Period() == timeframe2) G_ibuf_104[shift_28] = iStochastic(NULL, timeframe2, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_28);
else {
if (Period() > timeframe2) G_ibuf_104[shift_28] = EMPTY_VALUE;
else {
minute_0 = TimeMinute(Time[shift_28]);
Li_4 = MathMod(minute_0, timeframe2);
if (Li_4 != 0) {
shift_8 = iBarShift(NULL, timeframe2, Time[shift_28] - 60 * Li_4);
if (shift_8 == 0) G_ibuf_104[shift_28] = G_ibuf_104[shift_28 + 1];
else {
Ld_20 = iStochastic(NULL, timeframe2, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_8 - 1) - iStochastic(NULL, timeframe2, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_8);
Ld_20 = Ld_20 * Li_4 / timeframe2;
G_ibuf_104[shift_28] = iStochastic(NULL, timeframe2, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_8) + Ld_20;
}
} else {
shift_8 = iBarShift(NULL, timeframe2, Time[shift_28]);
G_ibuf_104[shift_28] = iStochastic(NULL, timeframe2, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_8);
}
}
}
if (Period() == timeframe3) G_ibuf_108[shift_28] = iStochastic(NULL, timeframe3, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_28);
else {
if (Period() > timeframe3) G_ibuf_108[shift_28] = EMPTY_VALUE;
else {
minute_0 = TimeMinute(Time[shift_28]);
Li_4 = MathMod(minute_0, timeframe3);
if (Li_4 != 0) {
shift_8 = iBarShift(NULL, timeframe3, Time[shift_28] - 60 * Li_4);
if (shift_8 == 0) {
G_ibuf_108[shift_28] = G_ibuf_108[shift_28 + 1];
continue;
}
Ld_20 = iStochastic(NULL, timeframe3, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_8 - 1) - iStochastic(NULL, timeframe3, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_8);
Ld_20 = Ld_20 * Li_4 / timeframe3;
G_ibuf_108[shift_28] = iStochastic(NULL, timeframe3, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_8) + Ld_20;
} else {
shift_8 = iBarShift(NULL, timeframe3, Time[shift_28]);
G_ibuf_108[shift_28] = iStochastic(NULL, timeframe3, 8, 3, 1, MODE_SMA, 0, MODE_SIGNAL, shift_8);
}
}
}
}
return (0);
}
|