Quote:
Originally Posted by funyoo
Ok, here is another version. The EA will only enter one trade per bar.
Dear Funyoo,
The last version of your EA is working fine thanks to you.
I am trying to check the impact of a "timing indicator" that seems usefull in filtering many bad trades. I found this timing indicator that you find attached in a forum dicussing the Belkhayate system.
The timing indicator states sell and buy areas where the trades can only be taken, basicaly only if the bar is red in the sell area a short trading signal using your EA should be taken and vice versa.
I have used an indicator "1_out_hist" to grabe the historical data of this timing indicator and do my analysis in excel to check out its impact on your EA. the "1_out_hist" grabs data very well on the normal
MT4 indicator but when I apply it to any cutom indicator all I get is the last value of the indicator throughout all history.
I attached for you the following files:
1. 1_out_hist.mq4: the indicator I used to grab data from the timing indicator
2. Mahmoud Amer -Timing H.ex4: the timing indicator, I have only the compiled version but I managed to get this part of the code that states the extern variables and the buffer necessary to know for the "1_out_hist.mq4" :
#property copyright "Mahmoud Amer, Copyright © 2009"
#property link "pisces7644@hotmail.com"
#property indicator_separate_window
#property indicator_minimum 0.0
#property indicator_maximum 40.0
#property indicator_buffers 8
#property indicator_color1 Black
#property indicator_color2 Black
#property indicator_color3 Black
#property indicator_color4 Black
#property indicator_color5 Black
#property indicator_color6 Black
#property indicator_color7 Black
#property indicator_color8 Black
#import "user32.dll"
int GetDC(int a0);
int ReleaseDC(int a0, int a1);
#import "gdi32.dll"
int GetPixel(int a0, int a1, int a2);
#import
extern color Bars_Up = Blue;
extern color Bars_Down = Red;
extern color Levels_Color = LightSteelBlue;
extern color Text_Color1 = Red;
extern color Text_Color2 = Blue;
int gi_96 = Snow;
int gi_100 = DarkGray;
int gi_104 = 240;
int gi_108 = 4;
int gi_112 = 0;
double gd_116 = 1.0;
int gi_124 = 500;
double gda_128[];
double gda_132[];
double gda_136[];
double gda_140[];
double gda_144[];
double gda_148[];
double gda_152[];
double gda_156[];
extern int fr = 40;
int gi_164 = 15;
int gi_168 = 30;
int gi_172 = 0;
string gs_176;
int gi_184;
int gi_188 = 100;
int init() {
int li_0 = WindowHandle(Symbol(), Period());
int li_4 = GetDC(li_0);
gi_184 = GetPixel(li_4, 1, 2);
ReleaseDC(li_0, li_4);
gi_96 = gi_184;
gi_100 = gi_184;
SetIndexBuffer(0, gda_128);
SetIndexBuffer(1, gda_132);
SetIndexBuffer(2, gda_136);
SetIndexBuffer(3, gda_152);
SetIndexBuffer(4, gda_140);
SetIndexBuffer(5, gda_144);
SetIndexBuffer(6, gda_148);
SetIndexBuffer(7, gda_156);
SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 14, Bars_Up);
SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 14, Bars_Down);
SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 14, gi_100);
SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 14, gi_96);
SetIndexStyle(4, DRAW_HISTOGRAM, STYLE_SOLID, 0, Bars_Up);
SetIndexStyle(5, DRAW_HISTOGRAM, STYLE_SOLID, 0, Bars_Down);
SetIndexStyle(6, DRAW_HISTOGRAM, STYLE_SOLID, 14, gi_100);
SetIndexStyle(7, DRAW_HISTOGRAM, STYLE_SOLID, 10, gi_96);
Comment(" Mahmoud Amer "
+ "\n"
+ "pisces7644@hotmail.com");
gs_176 = "Mahmoud Amer _ Timing";
IndicatorShortName(gs_176);
if (StringFind(Symbol(), "JPY") >= 0) gi_188 = 100;
else gi_188 = 10000;
ObjectDelete("A");
ObjectDelete("B");
ObjectDelete("Buy");
ObjectDelete("Sell");
return (0);
}
3. excel file of the data grabed usin the "1_out_hist.mq4", forget the first line in the sheet as i didnt chage it in the code "open, high, low..."
For the timing indicator to work, you need to all DLL import and you may need to restart MT4.
Can you please have a look, what I need is to grab the historical values of the timing indicator to use them in excel.
a million thanks to you funyou.
Way2Freedom
Attached Files Mahmoud Amer -Timing H.ex4 (11.3 KB, 65 views)
1_out_hist.mq4 (4.4 KB, 53 views)
GBPUSD30.txt (269.6 KB, 38 views)
Voice ce que j'ais trouvé sur le forum ou j'ais pris l'indic