Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
ADX_100_V3
//+------------------------------------------------------------------+
//| ADX Crossing.mq4
//| Amir
//+------------------------------------------------------------------+
#property copyright "Author - Amir"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Sienna
#property indicator_color2 Blue
//---- input parameters
extern int ADXbars=14;
extern int CountBars=650;
//---- buffers
double val1[];
double val2[];
double b4plusdi,nowplusdi,b4minusdi,nowminusdi,adxp,adxpp,adxm,adxmp,HI,LO;
//+------------------------------------------------------------------+
//| 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()
{
if (CountBars>=Bars) CountBars=Bars;
SetIndexDrawBegin(0,Bars-CountBars);
SetIndexDrawBegin(1,Bars-CountBars);
int i,shift,counted_bars=IndicatorCounted();
//---- 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--)
{
// mom = iMomentum(NULL,0,ADXbars,PRICE_CLOSE,shift-1);
// momp = iMomentum(NULL,0,ADXbars,PRICE_CLOSE,shift);
adxp = iADX(NULL,0,14,PRICE_CLOSE,MODE_PLUSDI,shift-1);
adxpp = iADX(NULL,0,14,PRICE_CLOSE,MODE_PLUSDI,shift);
adxm = iADX(NULL,0,14,PRICE_CLOSE,MODE_MINUSDI,shift-1);
adxmp = iADX(NULL,0,14,PRICE_CLOSE,MODE_MINUSDI,shift);
if (adxp>adxm && adxpp<adxmp )
//if (b4plusdi>b4minusdi && nowplusdi<nowminusdi)
{
//HI = (High[iHighest(NULL,0,MODE_HIGH,5,shift-1)]-Ask);
// LO = (Low[iLowest(NULL,0,MODE_LOW,5,shift-1)]);
LO = (Low[iLowest(NULL,0,MODE_LOW,5,shift-1)]);
//val1[shift-1]=Low[shift]+HI;
val1[shift-1]=LO;
}
if (adxp<adxm && adxpp>adxmp )
//if (b4plusdi<b4minusdi && nowplusdi>nowminusdi)
{
//LO = (Ask-Low[iLowest(NULL,0,MODE_LOW,5,shift-1)]);
// HI = (High[iHighest(NULL,0,MODE_HIGH,5,shift-1)]);
HI = (High[iHighest(NULL,0,MODE_HIGH,5,shift-1)]);
//val2[shift-1]=High[shift]-LO;
val2[shift-1]=HI;
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---