sign by price

Author: Wen Tao Xiong
0 Views
0 Downloads
0 Favorites
sign by price
ÿþ//+------------------------------------------------------------------+

//|                                                    sign by price.mq5 |

//|                                        wx=> wentxiong |

//|                                        http://www.popoding.club/ |

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

#property copyright "Wen Tao Xiong"

#property link      "https://www.mql5.com/zh/users/xiongsir/seller"

#property version   "1.00"



#property script_show_inputs



input color line_clr = clrBlue;

input ENUM_LINE_STYLE line_style = STYLE_SOLID;

input int line_width = 3;



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

//| Script program start function                                    |

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

void OnStart()

  {

//---



   double price_max = 2.00000;

   double price_min = 1.00000;

   double price_int[];

   ArrayResize(price_int,300);

   double price_tmp = price_min;

   int m = 0;

   for(m = 0 ; price_tmp <= price_max ; m++)

     {

      price_int[m] = price_tmp;

      price_tmp = price_tmp + 0.00500;

     }

   ArrayRemove(price_int,m);





   for(int i = 0 ; i < ArraySize(price_int); i++)

     {



      string line_name = DoubleToString(price_int[i]);

      if(!ObjectCreate(0,line_name,OBJ_HLINE,0,0,price_int[i]))

        {

         printf("draw a line error :d%", GetLastError());

        }





      ObjectSetInteger(0,line_name,OBJPROP_COLOR,line_clr);

      ObjectSetInteger(0,line_name,OBJPROP_STYLE,line_style);

      ObjectSetInteger(0,line_name,OBJPROP_WIDTH,line_width);

     }



  }

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

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