Miscellaneous
0
Views
0
Downloads
0
Favorites
All_Stars_v01
//+------------------------------------------------------------------+
//| All_Stars_v01.mq4 |
//+------------------------------------------------------------------+
#property copyright "Inkov Evgeni ew123@mail.ru"
#property link "+7-918-600-11-33"
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_width1 2
#property indicator_width2 2
//--------------------
double ExtBuffer0[];
double ExtBuffer1[];
double ExtBuffer2[];
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(3);
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexStyle(2,DRAW_NONE);
SetIndexBuffer(0,ExtBuffer0);
SetIndexBuffer(1,ExtBuffer1);
SetIndexBuffer(2,ExtBuffer2);
SetIndexEmptyValue(1,0.0);
SetIndexEmptyValue(2,0.0);
IndicatorDigits(0);
return(0);
}
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
double oc;
for(int i=0; i<limit; i++)
{
oc=MathAbs(Open[i]-Close[i]);
if (oc==0.0)oc=Point;
ExtBuffer2[i]=Volume[i]*(High[i]-Low[i])/oc;
}
double current,prev;
for(i=limit-1; i>=0; i--)
{
current=ExtBuffer2[i];
prev =ExtBuffer2[i+1];
if(current<prev)
{
ExtBuffer0[i]=0.0;
ExtBuffer1[i]=current;
}
else
{
ExtBuffer0[i]=current;
ExtBuffer1[i]=0.0;
}
}
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
---