Download MetaTrader 5

A simple script that puts a number of Wingding characters (arrow codes) over the last bar

To add comments, please log in or register
kypa
88
kypa  
By default it draws first 300 Wingding characters/arrow codes, which is about all of them I think (they start repeating at some point).

Tooltip (the little pop-up on hovering mouse pointer over the arrow) shows arrow code.

Script intended to visualize all possible looks for arrow indicator plots for an easier choice, it doesn't have indicating/advising/trading purpose by itself.

//+------------------------------------------------------------------+
//|                                                      Стрелки.mq5 |
//+------------------------------------------------------------------+

#property copyright "Copyright 2017, МегаКурец Software Corp."

#property script_show_inputs

   input int ПървиНомер = 1;
   input int ПоследенНомер = 300;
   input color Цвят = clrGreen;
   input int Размер = 5;
  
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+

void OnStart()
  {
   datetime Време = TimeCurrent();
   MqlTick дъ_ласт_тик;
   SymbolInfoTick(NULL,дъ_ласт_тик);
   double Цена = дъ_ласт_тик.bid;
   for (int хой = ПървиНомер; хой <=ПоследенНомер; хой++)
     {
      ObjectDelete(0,"Стрелка №"+IntegerToString(хой));
     }
   for (int кор = ПървиНомер; кор <=ПоследенНомер; кор++)
     {
      ObjectCreate(0,"Стрелка №"+IntegerToString(кор),OBJ_ARROW,0,Време,(Цена-0.00025*ПоследенНомер+0.0005*кор*Цена));
      ObjectSetInteger(0,"Стрелка №"+IntegerToString(кор),OBJPROP_ARROWCODE,кор);
      ObjectSetInteger(0,"Стрелка №"+IntegerToString(кор),OBJPROP_COLOR,Цвят);
      ObjectSetInteger(0,"Стрелка №"+IntegerToString(кор),OBJPROP_WIDTH,Размер);
     }  
  }
  
//+------------------------------------------------------------------+

Clearing script:

//+------------------------------------------------------------------+
//|                                           Стрелки-Почистване.mq5 |
//+------------------------------------------------------------------+

#property copyright "Copyright 2017, МегаКурец Software Corp."

#property script_show_inputs

   input int ПървиНомер = 1;
   input int ПоследенНомер = 300;
  
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+

void OnStart()
  {
   for (int пръц = ПървиНомер; пръц <=ПоследенНомер; пръц++)
     {
      ObjectDelete(0,"Стрелка №"+IntegerToString(пръц));
     }
  }
  
//+------------------------------------------------------------------+
Alain Verleyen
Moderator
33618
Alain Verleyen  

There are only 256.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Wingdings
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Wingdings
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Wingdings - Reference on algorithmic/automated trading language for MetaTrader 5
kypa
88
kypa  
Alain Verleyen:

There are only 256.

Even less than 256 - some of the codes are empty. This table is incomplete though - there are some characters before 32.

This shows them into multiple rows and columns, numbers of rows by choice, starts drawing from price on dropping (if script is dropped on the chart) or last bid (if not dropped):

//+------------------------------------------------------------------+
//|                                                      Стрелки.mq5 |
//+------------------------------------------------------------------+

#property copyright "Copyright 2017, МегаКурец Software Corp."

#property script_show_inputs

   int ПървиНомер = 1;
   int ПоследенНомер = 256;
  
   input color Цвят = clrGreen;
   input int Размер = 5;
   input int Редове = 10;
  
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+

void OnStart()
  {
   datetime Таймфрейм = PeriodSeconds(PERIOD_CURRENT);
   datetime ВремеТекущо = TimeCurrent();
   double ЦенаТекуща;
   double косъм = 0.5*(ChartGetDouble(0,CHART_PRICE_MAX,0)-ChartGetDouble(0,CHART_PRICE_MIN,0))/Редове;
   MqlTick дъ_ласт_тик;
   SymbolInfoTick(NULL,дъ_ласт_тик);
  
   if(!ChartPriceOnDropped()) ЦенаТекуща = дъ_ласт_тик.bid;
      else ЦенаТекуща = ChartPriceOnDropped();
      
   for (int хой = ПървиНомер; хой <=ПоследенНомер; хой++)
     {
      ObjectDelete(0,"Стрелка №"+IntegerToString(хой));
     }
    
   for (int кор = ПървиНомер; кор <=ПоследенНомер; кор++)
     {
      int пръц = MathCeil(кор/Редове);      
      datetime Време = ВремеТекущо - 5*пръц*Таймфрейм;
      double Цена = ЦенаТекуща + косъм*(кор-Редове*(пръц))*ЦенаТекуща;
      ObjectCreate(0,"Стрелка №"+IntegerToString(кор),OBJ_ARROW,0,Време,Цена);
      ObjectSetInteger(0,"Стрелка №"+IntegerToString(кор),OBJPROP_ARROWCODE,кор);
      ObjectSetInteger(0,"Стрелка №"+IntegerToString(кор),OBJPROP_COLOR,Цвят);
      ObjectSetInteger(0,"Стрелка №"+IntegerToString(кор),OBJPROP_WIDTH,Размер);
      ObjectSetInteger(0,"Стрелка №"+IntegerToString(кор),OBJPROP_SELECTABLE,true);
     }  
  }
  
//+------------------------------------------------------------------+
Alexander Fedosov
10180
Alexander Fedosov  
Hard to read this code
To add comments, please log in or register