Sem SAR+ADX

Author: ������� ������� (�) 2007
Sem SAR+ADX
Indicators Used
Movement directional indexParabolic Stop and Reverse system
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
Sem SAR+ADX
//+------------------------------------------------------------------+
//|                                  Áîëüøàÿ Êîëëåêöèÿ Ñåìàôîðîâ.mq4 |
//+------------------------------------------------------------------+
#property copyright "Ñåðãååâ Àëåêñåé (ñ) 2007"

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_buffers 4
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1
#property indicator_width4 1
#property indicator_color1 Crimson
#property indicator_color2 LimeGreen
#property indicator_color3 Crimson
#property indicator_color4 LimeGreen
#property indicator_style1 STYLE_SOLID
#property indicator_style2 STYLE_SOLID
#property indicator_style3 STYLE_SOLID
#property indicator_style4 STYLE_SOLID

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];

int init()
{
//---- indicators
	SetIndexStyle(0,DRAW_HISTOGRAM);	SetIndexBuffer(0,ExtMapBuffer1);
	SetIndexStyle(1,DRAW_HISTOGRAM);	SetIndexBuffer(1,ExtMapBuffer2);
	SetIndexStyle(2,DRAW_HISTOGRAM);	SetIndexBuffer(2,ExtMapBuffer3);
	SetIndexStyle(3,DRAW_HISTOGRAM);	SetIndexBuffer(3,ExtMapBuffer4);

	IndicatorShortName("SAR+ADX");  
	return(0);
}
int deinit()  { return(0); }

int start()
{
	double sar;
	double adxP,adxN;

	for (int i = 0; i < Bars; i++)
	{
		ExtMapBuffer1[i]=0; ExtMapBuffer2[i]=0; ExtMapBuffer3[i]=0; ExtMapBuffer4[i]=0;

		adxP=iADX(NULL,0,14 ,PRICE_CLOSE,1,i);//+DI
		adxN=iADX(NULL,0,14 ,PRICE_CLOSE,2,i);//-DI

		sar = iSAR(NULL,0,0.02,0.2,i) ;

		if (sar > Close[i] && adxN > adxP){ ExtMapBuffer1[i] = 1; }//ïðîäàåì ñèëüíî
		if (sar < Close[i] && adxP > adxN){ ExtMapBuffer2[i] = 1; }//ïîêóïàåì ñèëüíî
		if (sar > Close[i] && adxP > adxN){ ExtMapBuffer3[i] = 1; }//ïðîäàåì ñëàáî
		if (sar < Close[i] && adxN > adxP){ ExtMapBuffer4[i] = 1; }//ïîêóïàåì ñëàáî
	}
	return(0);
}
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---