Author: Yuriy Tokman (YTG)
0 Views
0 Downloads
0 Favorites
fon
ÿþ//+------------------------------------------------------------------+

//|                                                          fon.mq4 |

//|                                               Yuriy Tokman (YTG) |

//|                       https://www.mql5.com/ru/users/satop/seller |

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

#property copyright "Yuriy Tokman (YTG)"

#property link      "https://www.mql5.com/ru/users/satop/seller"

#property version   "1.00"

#property strict

#property script_show_inputs 



input int size_X = 1024;

input int size_Y = 768;

input string images = "\\Images\\1.bmp";



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

//| Script program start function                                    |

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

void OnStart()

  {

//---

 BitmapLabelCreate(0,"BmpLabel",0,             // =><5@ ?>4>:=0 

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

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

                       images,               // :0@B8=:0 2 @568<5 On 

                       images,              // :0@B8=:0 2 @568<5 Off 

                       size_X,                  // X-:>>@48=0B0 >1;0AB8 2848<>AB8 

                       size_Y,                 // Y-:>>@48=0B0 >1;0AB8 2848<>AB8 

                       0,              // A<5I5=85 >1;0AB8 2848<>AB8 ?> X 

                       0,              // A<5I5=85 >1;0AB8 2848<>AB8 ?> Y 

                       false,              // =060B0/>B60B0 

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

                       ANCHOR_LEFT_UPPER, // A?>A>1 ?@82O7:8  

                       clrRed,               // F25B @0<:8 ?@8 2K45;5=88 

                       STYLE_SOLID,        // AB8;L ;8=88 ?@8 2K45;5=88 

                       1,            // @07<5@ B>G:8 ?5@5<5I5=8O 

                       false,               // =0 704=5< ?;0=5 

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

                       false,              // A:@KB 2 A?8A:5 >1J5:B>2 

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



//----  

  }

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

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

//| !>7405B >1J5:B "@0D8G5A:0O <5B:0"                               | 

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

bool BitmapLabelCreate(const long              chart_ID=0,               // ID 3@0D8:0 

                       const string            name="BmpLabel",          // 8<O <5B:8 

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

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

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

                       const string            file_on="",               // :0@B8=:0 2 @568<5 On 

                       const string            file_off="",              // :0@B8=:0 2 @568<5 Off 

                       const int               width=0,                  // X-:>>@48=0B0 >1;0AB8 2848<>AB8 

                       const int               height=0,                 // Y-:>>@48=0B0 >1;0AB8 2848<>AB8 

                       const int               x_offset=10,              // A<5I5=85 >1;0AB8 2848<>AB8 ?> X 

                       const int               y_offset=10,              // A<5I5=85 >1;0AB8 2848<>AB8 ?> Y 

                       const bool              state=false,              // =060B0/>B60B0 

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

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

                       const color             clr=clrRed,               // F25B @0<:8 ?@8 2K45;5=88 

                       const ENUM_LINE_STYLE   style=STYLE_SOLID,        // AB8;L ;8=88 ?@8 2K45;5=88 

                       const int               point_width=1,            // @07<5@ B>G:8 ?5@5<5I5=8O 

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

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

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

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

  { 

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

   ResetLastError();

   ObjectDelete(chart_ID,name); 

//--- A>74048< 3@0D8G5A:CN <5B:C 

   if(!ObjectCreate(chart_ID,name,OBJ_BITMAP_LABEL,sub_window,0,0)) 

     { 

      Print(__FUNCTION__, 

            ": =5 C40;>AL A>740BL >1J5:B \"@0D8G5A:0O <5B:0\"! >4 >H81:8 = ",GetLastError()); 

      return(false); 

     } 

//--- CAB0=>28< :0@B8=:8 4;O @568<>2 On 8 Off 

   if(!ObjectSetString(chart_ID,name,OBJPROP_BMPFILE,0,file_on)) 

     { 

      Print(__FUNCTION__, 

            ": =5 C40;>AL 703@C78BL :0@B8=:C 4;O @568<0 On! >4 >H81:8 = ",GetLastError()); 

      return(false); 

     } 

   if(!ObjectSetString(chart_ID,name,OBJPROP_BMPFILE,1,file_off)) 

     { 

      Print(__FUNCTION__, 

            ": =5 C40;>AL 703@C78BL :0@B8=:C 4;O @568<0 Off! >4 >H81:8 = ",GetLastError()); 

      return(false); 

     } 

//--- CAB0=>28< :>>@48=0BK <5B:8 

   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x); 

   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y); 

//--- CAB0=>28< >1;0ABL 2848<>AB8 87>1@065=8O; 5A;8 7=0G5=8O H8@8=K 8;8 2KA>BK 

//--- 1>;LH5 7=0G5=89 H8@8=K 8 2KA>BK (A>>B25BAB25==>) 8AE>4=>3> 87>1@065=8O, B> 

//--- >=> =5 @8AC5BAO; 5A;8 7=0G5=8O H8@8=K 8 2KA>BK <5=LH5 @07<5@>2 87>1@065=8O, 

//--- B> @8AC5BAO B0 53> G0ABL, :>B>@0O A>>B25BAB2C5B MB8< @07<5@0< 

   ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,width); 

   ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,height); 

//--- CAB0=>28<, :0:0O G0ABL 87>1@065=8O 4>;6=0 ?>:07K20BLAO 2 >1;0AB8 2848<>AB8 

//--- ?> C<>;G0=8N MB> ;520O 25@E=OO >1;0ABL 87>1@065=8O; 7=0G5=8O ?>72>;ONB 

//--- ?@>8725AB8 A4283 >B MB>3> C3;0 8 >B>1@078BL 4@C3CN G0ABL 87>1@065=8O 

   ObjectSetInteger(chart_ID,name,OBJPROP_XOFFSET,x_offset); 

   ObjectSetInteger(chart_ID,name,OBJPROP_YOFFSET,y_offset); 

//--- CAB0=>28<, 2 :0:>< A>B>O=88 =0E>48BAO <5B:0 (=060B>< 8;8 >B60B><) 

   ObjectSetInteger(chart_ID,name,OBJPROP_STATE,state); 

//--- 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< A?>A>1 ?@82O7:8 

   ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor); 

//--- CAB0=>28< F25B @0<:8 ?@8 2:;NG5==>< @568<5 2K45;5=8O >1J5:B0 

   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr); 

//--- CAB0=>28< AB8;L ;8=88 @0<:8 ?@8 2:;NG5==>< @568<5 2K45;5=8O >1J5:B0 

   ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style); 

//--- CAB0=>28< @07<5@ B>G:8 ?@82O7:8, A ?><>ILN :>B>@>9 <>6=> ?5@5<5I0BL >1J5:B 

   ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,point_width); 

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