Price Data Components
Miscellaneous
0
Views
0
Downloads
0
Favorites
80-20_mtf
//+------------------------------------------------------------------+
//| DOSR_Dots.mq4 |
//| aleks121 |
//+------------------------------------------------------------------+
//mod InnBar mtf
#property copyright "aleks121"
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 MediumVioletRed
#property indicator_width1 2
#property indicator_width2 2
//----
double val1[];
double val2[];
//----
extern int tf=60;
extern double t1=0.1;
extern double t2=0.2;
extern double t3=0.8;
extern double t4=0.9;
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexBuffer(0,val1);
SetIndexBuffer(1,val2);
//
SetIndexStyle(0,DRAW_ARROW);
SetIndexStyle(1,DRAW_ARROW);
//
SetIndexArrow(0,158);
SetIndexArrow(1,158);
//
SetIndexEmptyValue(0,EMPTY_VALUE);
SetIndexEmptyValue(1,EMPTY_VALUE);
//
SetIndexLabel(0,"insideBar Hi");
SetIndexLabel(1,"insideBar Lo");
if(tf<Period())tf=Period();
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
if(counted_bars==0) limit-=1+tf/Period();
//----
for(int i=0; i<limit; i++)
{
int bs=iBarShift(Symbol(),tf,Time[i]);
//----
double H=iHigh(Symbol(),tf,bs);
double L=iLow(Symbol(),tf,bs);
double C=iClose(Symbol(),tf,bs);
double O=iOpen(Symbol(),tf,bs);
double HL = H - L;
double HO = H - O;
double HC = H - C;
val1[i]=EMPTY_VALUE;
val2[i]=EMPTY_VALUE;
if(HL!=0)
{
//----
if((HO/HL<t2) && (HO/HL>t1) && (HC/HL>t3) && (HC/HL<t4))
{
val1[i]=H; val2[i]=L;
}
if((HO/HL>t3) && (HO/HL<t4) && (HC/HL<t2) && (HC/HL>t1))
{
val1[i]=H; val2[i]=L;
}
}
}
//----
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
---