Author: Copyright � 2009, Yuriy Tokman
ytg_2
0 Views
0 Downloads
0 Favorites
ytg_2
//+------------------------------------------------------------------+
//|                                                        ytg_2.mq4 |
//|                                   Copyright © 2009, Yuriy Tokman |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

#property indicator_chart_window

int j = 0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectDelete ("Òåêñò");  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   j=j+1;if(j>9)j=0;   
//----
   SetText("Òåêñò","Öâåò øðèôòà",1,350,50,30, "Arial Black", GetColorTF(j));   
//----
   return(0);
  }
//+----------------------------------------------------------------------------+
//|  Îïèñàíèå : Âîçâðàùàåò öâåò                                                |
//+----------------------------------------------------------------------------+
//|  Ïàðàìåòðû:                                                                |
//|  n - ïðîèçâîëüíîå ÷èñëî îò 1-10                                            |
//+----------------------------------------------------------------------------+
color GetColorTF(int n = 1) {
  switch (n) {
    case 1:  return(LightSlateGray);
    case 2:  return(Khaki);
    case 3:  return(Red);
    case 4:  return(Orange);
    case 5:  return(Yellow);
    case 6:  return(Lime);
    case 7:  return(White);
    case 8:  return(DodgerBlue);
    case 9:  return(Orchid);
    case 10: return(Blue);    
    default: return(LightPink);
  }
}

//+------------------------------------------------------------------+
void SetText(string name,string text,int CORNER,int XDISTANCE,int YDISTANCE, 
             int font_size, string font_name, color text_color=CLR_NONE)
 {
  if (ObjectFind(name)!=-1) ObjectDelete(name);
  ObjectCreate(name,OBJ_LABEL,0,0,0,0,0);         
  ObjectSet(name,OBJPROP_CORNER,CORNER);
  ObjectSet(name,OBJPROP_XDISTANCE,XDISTANCE);
  ObjectSet(name,OBJPROP_YDISTANCE,YDISTANCE);
  ObjectSetText(name,text,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 ---