Author: Copyright � 2006, MetaQuotes Software Corp.
TradeSig
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
TradeSig
//+------------------------------------------------------------------+
//|                                                        SmCCI.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Lime
//---- input parameters

extern int       per=21;
/*extern int       nBar=300;*/
extern int       sdvig=5;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double malim, mared;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
      //---- check for possible errors
   if(counted_bars<0) return(-1);
      //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
      //---- macd counted in the 1-st buffer
   for(int i=0; i<limit; i++)
   
   {
      malim=iMA(NULL,0,per,0,MODE_SMA,PRICE_CLOSE,i);
      mared=iMA(NULL,0,per,0,MODE_SMA,PRICE_CLOSE,i+sdvig);
      ExtMapBuffer1[i]=malim;
      ExtMapBuffer2[i]=mared;
   }
   
   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 ---