Author: Integer
s_Test
0 Views
0 Downloads
0 Favorites
s_Test
//+------------------------------------------------------------------+
//|                                                       s_Test.mq4 |
//|                                                                * |
//|                                                                * |
//+------------------------------------------------------------------+
#property copyright "Integer"
#property link      "for-good-letters@yandex.ru"

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
//----

   double f=0;
   double s=0.03;
   while(!IsStopped()){
      int y=MathAbs(MathSin(f))*100;
      f+=s;
         if(y<12){
            fObjLabel("Smile",25,y,StringSetChar("",0,75),2,Red,50,0,"WingDings",false);
         }
         else{
            fObjLabel("Smile",25,y,StringSetChar("",0,74),2,Red,50,0,"WingDings",false);         
         }
      WindowRedraw();
      Sleep(1);
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
int deinit(){
   ObjectDelete("Smile");
   WindowRedraw();
}
void fObjLabel(
   string aObjectName,     // 1 èìÿ
   int aX,                 // 2 õ
   int aY,                 // 3 ó
   string aText,           // 4 òåêñò
   int aCorner=0,          // 5 óãîë   0  1
                           //          2  3
   color aColor=Red,       // 6 öâåò
   int aFontSize=8,        // 7 ðàçìåð øðèôòà
   int aWindowNumber=0,    // 8 îêíî
   string aFont="Arial",   // 9 øðèôò
   bool aBack=false        // 10 ôîí
   ){     
      if(ObjectFind(aObjectName)!=aWindowNumber){
         ObjectCreate(aObjectName,OBJ_LABEL,aWindowNumber,0,0);
      }      
   ObjectSet(aObjectName,OBJPROP_XDISTANCE,aX);
   ObjectSet(aObjectName,OBJPROP_YDISTANCE,aY);   
   ObjectSetText(aObjectName,aText,aFontSize,aFont,aColor);
   ObjectSet(aObjectName,OBJPROP_BACK,aBack);
   ObjectSet(aObjectName,OBJPROP_CORNER,aCorner);   
}

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