Miscellaneous
0
Views
0
Downloads
0
Favorites
Heiken_Ashi_JMa
//+------------------------------------------------------------------+
//| Heiken Ashi JMa.mq4 |
//+------------------------------------------------------------------+
//____________________________\¦/
//___________________________(ò ó)
//______________________o0o___(_)___o0o__
//___¦_____¦_____¦_____¦_____¦_____¦_____¦
//¦_____¦_____¦_____¦_____¦_____¦_____¦__
//___¦_____¦_____¦_____¦_____¦_____¦_____¦
//¦_____¦_____¦_____¦_____¦_____¦_____¦__
#property copyright "Copyright © 2006, Forex-TSD.com "
#property link "http://www.forex-tsd.com/"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Red
#property indicator_color4 Green
extern int JMaPeriod = 50;
extern int JMaPhase = 0;
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
int ExtCountedBars=0;
int init()
{
SetIndexStyle(0,DRAW_HISTOGRAM, 0, 2, Red);
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexStyle(1,DRAW_HISTOGRAM, 0, 2, Green);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, Red);
SetIndexBuffer(2, ExtMapBuffer3);
SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, Green);
SetIndexBuffer(3, ExtMapBuffer4);
SetIndexDrawBegin(0,5);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexBuffer(3,ExtMapBuffer4);
return(0);
}
int start()
{
double maOpen, maClose, maLow, maHigh;
double haOpen, haHigh, haLow, haClose;
if(Bars<=10) return(0);
ExtCountedBars=IndicatorCounted();
if (ExtCountedBars<0) return(-1);
if (ExtCountedBars>0) ExtCountedBars--;
int i=Bars-ExtCountedBars-1;
while(i>=0)
{
maOpen=iCustom(NULL,0,"JJMA",JMaPeriod,JMaPhase,0,1,0,i);
maClose=iCustom(NULL,0,"JJMA",JMaPeriod,JMaPhase,0,0,0,i);
maLow=iCustom(NULL,0,"JJMA",JMaPeriod,JMaPhase,0,3,0,i);
maHigh=iCustom(NULL,0,"JJMA",JMaPeriod,JMaPhase,0,2,0,i);
haOpen=(ExtMapBuffer3[i+1]+ExtMapBuffer4[i+1])/2;
haClose=(maOpen+maHigh+maLow+maClose)/4;
haHigh=MathMax(maHigh, MathMax(haOpen, haClose));
haLow=MathMin(maLow, MathMin(haOpen, haClose));
if (haOpen<haClose)
{
ExtMapBuffer1[i]=haLow;
ExtMapBuffer2[i]=haHigh;
}
else
{
ExtMapBuffer1[i]=haHigh;
ExtMapBuffer2[i]=haLow;
}
ExtMapBuffer3[i]=haOpen;
ExtMapBuffer4[i]=haClose;
i--;
}
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
---