Author: Copyright 2018, MetaQuotes Software Corp.
0 Views
0 Downloads
0 Favorites
Info_v1
ÿþ//+------------------------------------------------------------------+

//|                                                         Info.mq4 |

//|                        Copyright 2018, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright 2018, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

#property strict

#property indicator_chart_window

//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int OnInit()

  {

//--- indicator buffers mapping

  

//---

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Custom indicator iteration function                              |

//+------------------------------------------------------------------+

int OnCalculate(const int rates_total,

                const int prev_calculated,

                const datetime &time[],

                const double &open[],

                const double &high[],

                const double &low[],

                const double &close[],

                const long &tick_volume[],

                const long &volume[],

                const int &spread[])

  {

//---

  OutText("Label",             // 8<O <5B:8

          "PLEASE LOAD COREL.ZIP",             // B5:AB

             20,                      // :>>@48=0B0 ?> >A8 X

             20,                      // :>>@48=0B0 ?> >A8 Y

             clrBlueViolet,            // F25B

             30,

             CORNER_LEFT_UPPER

            );    

//--- return value of prev_calculated for next call

   return(rates_total);

  }

//+------------------------------------------------------------------+

bool OutText(const string            name="Label",             // 8<O <5B:8

             const string            text="Label",             // B5:AB

             const int               x=0,                      // :>>@48=0B0 ?> >A8 X

             const int               y=0,                      // :>>@48=0B0 ?> >A8 Y

             const color             clr=clrYellow,            // F25B

             const int               font_size=12,             // @07<5@ H@8DB0

             const ENUM_BASE_CORNER  corner=CORNER_LEFT_UPPER, // C3>; 3@0D8:0 4;O ?@82O7:8

             const ENUM_ANCHOR_POINT anchor=ANCHOR_LEFT_LOWER, // A?>A>1 ?@82O7:8

             const string            font="Arial",             // H@8DB

             const double            angle=0.0,                // =0:;>= B5:AB0

             const bool              back=false,               // =0 704=5< ?;0=5

             const bool              selection=false,          // 2K45;8BL 4;O ?5@5<5I5=89

             const bool              hidden=false,              // A:@KB 2 A?8A:5 >1J5:B>2

             const long              z_order=0,

             const int               sub_window=0,             // =><5@ ?>4>:=0

             const long              chart_ID=0                // ID 3@0D8:0

            )                // ?@8>@8B5B =0 =060B85 <KHLN

  {

//--- A1@>A8< 7=0G5=85 >H81:8

   ResetLastError();

//--- A>74048< B5:AB>2CN <5B:C

   if(ObjectFind(chart_ID,name)==-1)

     {

      if(!ObjectCreate(chart_ID,name,OBJ_LABEL,sub_window,x,y))

        {

         Print(__FUNCTION__, ": =5 C40;>AL A>740BL B5:AB>2CN <5B:C! >4 >H81:8 = ",GetLastError());

         //       return(false);

        }

     }



//--- CAB0=>28< C3>; 3@0D8:0, >B=>A8B5;L=> :>B>@>3> 1C4CB >?@545;OBLAO :>>@48=0BK B>G:8

   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner);

//--- CAB0=>28< B5:AB

   ObjectSetString(chart_ID,name,OBJPROP_TEXT,text);

//--- CAB0=>28< H@8DB B5:AB0

   ObjectSetString(chart_ID,name,OBJPROP_FONT,font);

//--- CAB0=>28< @07<5@ H@8DB0

   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size);

//--- CAB0=>28< C3>; =0:;>=0 B5:AB0

   ObjectSetDouble(chart_ID,name,OBJPROP_ANGLE,angle);

//--- CAB0=>28< A?>A>1 ?@82O7:8

   ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor);

//--- CAB0=>28< F25B

   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);

//--- >B>1@078< =0 ?5@54=5< (false) 8;8 704=5< (true) ?;0=5

   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);

//--- 2:;NG8< (true) 8;8 >B:;NG8< (false) @568< ?5@5<5I5=8O <5B:8 <KHLN

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);

//--- A:@>5< (true) 8;8 >B>1@078< (false) 8<O 3@0D8G5A:>3> >1J5:B0 2 A?8A:5 >1J5:B>2

   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);

//--- CAB0=>28< ?@8>@8B5B =0 ?>;CG5=85 A>1KB8O =060B8O <KH8 =0 3@0D8:5

   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);

//--- CA?5H=>5 2K?>;=5=85

   return(true);

  }



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