RoundNumbers

Author: Samura
0 Views
0 Downloads
0 Favorites
RoundNumbers
//+------------------------------------------------------------------+
//|                                         Óðîâíè êðóãëûõ ÷èñåë.mq4 |
//|                                                   Samura
//|                                  http://budobudda.wordpress.com/ |
//+------------------------------------------------------------------+
#property copyright "Samura"
#property link      "http://budobudda.wordpress.com/"

#property indicator_chart_window
//---- input parameters
extern color     line_color=clrLightSteelBlue;
extern int       width= 2;
extern double    begin= 0.7;
extern int       count= 10;
extern double    step=0.1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectsDeleteAll();
// óäàëÿåì âñå îáúåêòû

   return(0);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double total=count*step;
//---
   for(double i=0; i<total; i=i+step)
     {
      string object_name = (string)i;
      double price = begin + i;
      ObjectCreate(object_name,OBJ_HLINE,0,0,price);
      ObjectSet(object_name,OBJPROP_COLOR,line_color);
      ObjectSet(object_name,OBJPROP_WIDTH,width);

     }

//----
   return(0);
  }
//+------------------------------------------------------------------+

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