Miscellaneous
0
Views
0
Downloads
0
Favorites
prusax_v8
//+------------------------------------------------------------------+
//| prusax_v8.mq4
//|
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 Red
#property indicator_width1 3
#property indicator_width2 3
//---- buffers
double BufferUP[];
double BufferDN[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,BufferUP);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexBuffer(1,BufferDN);
SetIndexDrawBegin(0,10);
SetIndexDrawBegin(1,10);
//----
return(0);
}
//+------------------------------------------------------------------+
//|
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
double UP,DN;
//----
for(i=Bars-counted_bars-1;i>=0;i--)
{
UP = ((High[i]-Open[i])+(Close[i]-Low[i]));
DN = ((Open[i]-Low[i])+(High[i]-Close[i]));
if (UP > DN) {
BufferUP[i] = UP-DN;
BufferDN[i] = 0.0;
}
if (UP < DN) {
BufferUP[i] = 0.0;
BufferDN[i] = -1*(DN-UP);
}
}
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
---