[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 158
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
in a trend change over a period of time... See https://www.mql5.com/ru/forum/131277/page148 and https://www.mql5.com/ru/forum/131277/page149
Let's make one together. Do you have any developments? I also have a waving indicator that shows which direction it's going in - do you need it?
let's say :
Thank you, I tried something like that. I have tried it but, unfortunately, it does not work.
I want to try to make an EA using this indicator, but I do not know how to use iCustom to open it.
//+------------------------------------------------------------------+
//| ADX Crossing.mq4
//| Amir
//+------------------------------------------------------------------+
#property copyright "Author - Amir"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
//---- input parameters
extern int ADXbars=14;
extern int CountBars=1000;
extern int Level=25;
//---- buffers
double val1[];
double val2[];
double b4plusdi,nowplusdi,b4minusdi,nowminusdi;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,108);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,108);
SetIndexBuffer(0,val1);
SetIndexBuffer(1,val2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2 |
//+------------------------------------------------------------------+
int start()
{
double adx;
if (CountBars>=Bars) CountBars=Bars;
SetIndexDrawBegin(0,Bars-CountBars);
SetIndexDrawBegin(1,Bars-CountBars);
int i,shift,counted_bars;
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- initial zero
if(counted_bars<1)
{
for(i=1;i<=CountBars;i++) val1[CountBars-i]=0.0;
for(i=1;i<=CountBars;i++) val2[CountBars-i]=0.0;
}
for (shift = CountBars; shift>=0; shift--)
{
adx=iADX(NULL,0,ADXbars,PRICE_CLOSE,MODE_MAIN,shift);
b4plusdi=iADX(NULL,0,ADXbars,PRICE_CLOSE,MODE_PLUSDI,shift-1);
nowplusdi=iADX(NULL,0,ADXbars,PRICE_CLOSE,MODE_PLUSDI,shift);
b4minusdi=iADX(NULL,0,ADXbars,PRICE_CLOSE,MODE_MINUSDI,shift-1);
nowminusdi=iADX(NULL,0,ADXbars,PRICE_CLOSE,MODE_MINUSDI,shift);
if (b4plusdi>b4minusdi && nowplusdi<nowminusdi && adx>Level)
{
val1[shift]=Low[shift]-5*Point;
}
if (b4plusdi<b4minusdi && nowplusdi>nowminusdi && adx>Level)
{
val2[shift]=High[shift]+5*Point;
}
}
return(0);
}
//+------------------------------------------------------------------+
Thank you, I tried something like that. But, unfortunately, it does not work.
The indicator draws points, I want to try to make an EA using it, but I do not understand how to write the opening condition through iCustom.
Hi all! Have you seen what a good trading strategy 20/200 pips after 6pm:
Who has the Power Index as a bar graph? Post the code.
RSI - Relative Strength Index ?
todem, I tried if (d1!=0)
but the EA still opens in a wrong place. In general, it should change Buy to Sell, but sometimes it opens twice for Sell. Maybe I have not copied something.
todem, I tried if (d1!=0)
but the EA still opens in a wrong place. In general, it should change Buy to Sell, but sometimes it opens twice for Sell. Maybe I have not copied something.
Send me the code and I will correct it