Author: QuantifiEd
SeNSetiVe
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
SeNSetiVe
//+------------------------------------------------------------------+
//|   SeNSetiVe.mq4                                                  |
//|   QuantifiEd                                                     |           
//|   MySpons@rambler.ru                            Copyright © 2006 |
//+------------------------------------------------------------------+
#property copyright "QuantifiEd"
#property link      ""
//----
#property  indicator_separate_window
#property  indicator_buffers 1
#property indicator_color1 DarkBlue
//----
extern int SPerioD=150;
extern int SFactoR=7;
extern int ShiFt=0;
double buff[];
double Max,Min;
int init()
  {
   string SN;
//----
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,buff);
   SN="SeNSetiVe("+SPerioD+","+SFactoR+","+ShiFt+")";
   IndicatorShortName(SN);
   SetIndexLabel(0,SN);
   SetIndexDrawBegin(0,SPerioD);
//----
  return(0); 
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   int i,counted_bars=IndicatorCounted();  
//----
   if(Bars<=SPerioD) return(0);
   if(counted_bars<1)
      for(i=1;i<=SPerioD;i++) buff[Bars-i]=0.0;
   i=Bars-SPerioD-1;
   if(counted_bars>=SPerioD) i=Bars-counted_bars-1;
   while(i>=0)
     {
      Max=High[Highest(Symbol(),0,MODE_HIGH,SFactoR,i)];
      Min=Low[Lowest(Symbol(),0,MODE_LOW,SFactoR,i)];
      double hi =iMA(NULL,0,SPerioD,ShiFt,MODE_SMA,PRICE_HIGH,i);
      double lo =iMA(NULL,0,SPerioD,ShiFt,MODE_SMA,PRICE_LOW,i);
      double op =iMA(NULL,0,SPerioD,ShiFt,MODE_SMA,PRICE_OPEN,i);
      double cl =iMA(NULL,0,SPerioD,ShiFt,MODE_SMA,PRICE_CLOSE,i);
      buff[i]=(5*cl-5*op+Max+Min-hi-lo)*Volume[i];
     i--; }
   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 ---