MomemtInTime

Author: Copyright � 2010, LeMan.
Miscellaneous
Implements a curve of type %1
2 Views
0 Downloads
0 Favorites
MomemtInTime
//+------------------------------------------------------------------+
//|                                                 MomemtInTime.mq4 |
//|                                         Copyright © 2010, LeMan. |
//|                                                 b-market@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, LeMan."
#property link      "b-market@mail.ru"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Red
#property indicator_width1 1
#property indicator_width2 2

extern string tm    = "00:00";
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(2);
   IndicatorDigits(Digits);
   IndicatorShortName("MomemtInTime("+tm+")");
//----
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,159);
   SetIndexBuffer(1,ExtMapBuffer2);   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double t = 0;  
   int i = Bars-1;   
//----
   while(i>=0) {
      ExtMapBuffer2[i] = EMPTY_VALUE;
      if (TimeToStr(Time[i],TIME_MINUTES) == tm) {
         t = Open[i];
         ExtMapBuffer2[i] = 0;
      }
      ExtMapBuffer1[i] = NormalizeDouble(Close[i]-t, Digits);
      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 ---