Author: Yuriy Tokman (YTG)
Miscellaneous
Implements a curve of type %1
2 Views
0 Downloads
0 Favorites
Russia
//+------------------------------------------------------------------+
//|                                                       Russia.mq4 |
//|                                               Yuriy Tokman (YTG) |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman (YTG)"
#property link      "yuriytokman@gmail.com"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 White
#property indicator_width1 4
#property indicator_width2 4
#property indicator_width3 4
extern string EA_forex_FREE = "http://www.forexinvest.ee";
double Up[];
double Cr[];
double Dn[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorShortName("Russia");
   SetIndexBuffer(0,Up);
   SetIndexBuffer(1,Dn);
   SetIndexBuffer(2,Cr);     
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexStyle(2,DRAW_HISTOGRAM);   
   IndicatorDigits(1); IndexLab();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
//----
   int limit;
   int counted_bars=IndicatorCounted();   
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   if(counted_bars==0) limit--;
   
   for(int i=limit; i>=0; i--)
    {
     Cr[i]=1;     
     Up[i]=-2;
     Dn[i]=-1;
    }      
//----
   return(0);
  }
//+------------------------------------------------------------------+
void IndexLab()
 {
  string char1[256]; int i;
  for (i = 0; i < 256; i++) char1[i] = CharToStr(i);   
  string txtt = 
  char1[104]+char1[116]+char1[116]+char1[112]+char1[58]+char1[47]+char1[47]+char1[119]+char1[119]
  +char1[119]+char1[46]+char1[102]+char1[111]+char1[114]+char1[101]+char1[120]+char1[105]+char1[110]
  +char1[118]+char1[101]+char1[115]+char1[116]+char1[46]+char1[101]+char1[101]
  ; Label("label",txtt,2,3,15,10);  
 }
//----+
void Label(string name_label,string text_label,int corner = 2,int x = 3,int y = 15,int font_size = 10,string font_name = "Arial Black",color text_color = LimeGreen )
 {
  if (ObjectFind(name_label)!=-1) ObjectDelete(name_label);
  ObjectCreate(name_label,OBJ_LABEL,0,0,0,0,0);         
  ObjectSet(name_label,OBJPROP_CORNER,corner);
  ObjectSet(name_label,OBJPROP_XDISTANCE,x);
  ObjectSet(name_label,OBJPROP_YDISTANCE,y);
  ObjectSetText(name_label,text_label,font_size,font_name,text_color);
 }
//----+ 

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 ---