hello sir i would like to thank you for the best ea you can see but :
can you add this to the
Grid averager pro v2
and thanks for ever thing you do
how about to add restriction to the buy order :
1-if trend is up in the 1H is up use buy in 1M , if 4H is up use buy in 5M and so on
and the restriction to sell if the trend is sell:
1- if trend is down in the 1H chart use sell in 1M and so on
and this is the code for the trend indicator :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//+------------------------------------------------------------------+
//| SuperTrend.mq4 |
//| SuperTrend | Copyright © 2017 |
//|
http://fxprosystems.com |
//+------------------------------------------------------------------+
[HASHTAG]#property[/HASHTAG] copyright "SuperTrend | Copyright © 2017"
[HASHTAG]#property[/HASHTAG] link "
http://fxprosystems.com"
[HASHTAG]#property[/HASHTAG] indicator_chart_window
[HASHTAG]#property[/HASHTAG] indicator_buffers 4
[HASHTAG]#property[/HASHTAG] indicator_color1 DodgerBlue
[HASHTAG]#property[/HASHTAG] indicator_color2 Red
[HASHTAG]#property[/HASHTAG] indicator_width1 3
[HASHTAG]#property[/HASHTAG] indicator_width2 3
double TrendUp[];
double TrendDown[];
int st = 0;
//extern int SlowerEMA = 6;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 5);
SetIndexBuffer(0, TrendUp);
SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 5);
SetIndexBuffer(1, TrendDown);
/*SetIndexStyle(0, DRAW_ARROW, EMPTY);
SetIndexArrow(0, 159);
SetIndexBuffer(0, TrendUp);
SetIndexStyle(1, DRAW_ARROW, EMPTY);
SetIndexArrow(1, 159);
SetIndexBuffer(1, TrendDown);*/
/*for(int i = 0; i < Bars; i++) {
TrendUp
= NULL;
TrendDown = NULL;
}*/
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
/*for(int i = 0; i < Bars; i++) {
TrendUp = NULL;
TrendDown = NULL;
}*/
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit, i, counter;
double Range, AvgRange, cciTrendNow, cciTrendPrevious, var;
int counted_bars = IndicatorCounted();
//---- check for possible errors
if(counted_bars < 0) return(-1);
//---- last counted bar will be recounted
if(counted_bars > 0) counted_bars--;
limit=Bars-counted_bars;
for(i = limit; i >= 0; i--) {
cciTrendNow = iCCI(NULL, 0, 50, PRICE_TYPICAL, i);
cciTrendPrevious = iCCI(NULL, 0, 50, PRICE_TYPICAL, i+1);
//st = st * 100;
counter = i;
Range = 0;
AvgRange = 0;
for (counter = i; counter >= i-9; counter--) {
AvgRange = AvgRange + MathAbs(High[counter]-Low[counter]);
}
Range = AvgRange/10;
if (cciTrendNow >= st && cciTrendPrevious < st) {
TrendUp[i+1] = TrendDown[i+1];
}
if (cciTrendNow <= st && cciTrendPrevious > st) {
TrendDown[i+1] = TrendUp[i+1];
}
if (cciTrendNow >= st) {
TrendUp = Low - iATR(NULL, 0, 5, i);
if (TrendUp < TrendUp[i+1]) {
TrendUp = TrendUp[i+1];
}
}
else if (cciTrendNow <= st) {
TrendDown = High + iATR(NULL, 0, 5, i);
if (TrendDown > TrendDown[i+1]) {
TrendDown = TrendDown[i+1];
}
}
}
//----
//----
return(0);
}
//+------------------------------------------------------------------+
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------