Author: aleks121
Price Data Components
Series array that contains the highest prices of each barSeries array that contains the lowest prices of each barSeries array that contains close prices for each barSeries array that contains open prices of each bar
Miscellaneous
Implements a curve of type %1
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 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 ---