Download MetaTrader 5

DayOfWeek-Names vertically at the top

To add comments, please log in or register
BurkhardWille
176
BurkhardWille  

Hi,

is there maybe a finished indicator, which show me the DayOfWeek-Names vertically at the top (or bottom), like in my picture (text created manually to show my request).


Regards

Burkhard

BurkhardWille
176
BurkhardWille  
SYED NAUFAL GADDAFI
1399
SYED NAUFAL GADDAFI  
Google?
Alain Verleyen
Moderator
32783
Alain Verleyen  
BurkhardWille:

Did you search the Codebase ?
BurkhardWille
176
BurkhardWille  
deysmacro:
Google?

wow, realy good help, thank you. :-X


angevoyageur:
Did you search the Codebase ?

sure, but the nearest code of vertical text is from "News event indicator" (https://www.mql5.com/en/code/10459), but the code dont work with the new MT4 > build 600, so my question is still on top.

Tjipke de Vries
6372
Tjipke de Vries  
BurkhardWille:

wow, realy good help, thank you. :-X


sure, but the nearest code of vertical text is from "News event indicator" (https://www.mql5.com/en/code/10459), but the code dont work with the new MT4 > build 600, so my question is still on top.


Then look to the part of the code where the line is created with the text

      if(!skip)
        {
         if(ImpactToNumber(news[i][COLUMN_IMPORTANCE])>impact)impact=ImpactToNumber(news[i][COLUMN_IMPORTANCE]);
         if(StrToTime(news[i][COLUMN_DATE]+" "+news[i][COLUMN_TIME])== current) continue;
         current=(broker-local)+StrToTime(news[i][COLUMN_DATE]+" "+news[i][COLUMN_TIME]);
         color clr = low_color;
         if(impact == 2) clr = medium_color;  else
         if(impact == 3)clr = high_color;
 
         string text="";
         if(news[i][COLUMN_PREVIOUS]!="" || news[i][COLUMN_FORECAST]!="") text="["+news[i][COLUMN_PREVIOUS]+", "+news[i][COLUMN_FORECAST]+"]";
         if(news[i][COLUMN_IMPORTANCE]!="") text=text+" "+news[i][COLUMN_IMPORTANCE];
 
         ObjectCreate("NewsLine"+i,OBJ_VLINE,0,current,0);
         ObjectSet("NewsLine"+i,OBJPROP_COLOR,clr);
         ObjectSet("NewsLine"+i,OBJPROP_STYLE,STYLE_DASHDOTDOT);
         ObjectSet("NewsLine"+i,OBJPROP_BACK,true);
         ObjectSetText("NewsLine"+i,news[i][COLUMN_DATE]+" "+news[i][COLUMN_DESCRIPTION]+" "+text,8);
 
         if(showLineText)
           {
            if(Period()<PERIOD_H4)
              {
               ObjectCreate("NewsText"+i,OBJ_TEXT,0,current,WindowPriceMin()+(WindowPriceMax()-WindowPriceMin())*0.8);
               ObjectSet("NewsText"+i,OBJPROP_COLOR,clr);
               ObjectSet("NewsText"+i,OBJPROP_ANGLE,90);
               ObjectSetText("NewsText"+i,news[i][COLUMN_DATE]+" "+news[i][COLUMN_DESCRIPTION]+" "+text,8);
              }
           }
        }
BurkhardWille
176
BurkhardWille  

How you can see, the position of the text is not correctly:

WindowPriceMin()+(WindowPriceMax()-WindowPriceMin())*0.8

The images of the indicator dont match with the code.


I guess, WindowPrice is not a good solution, because only at a new tick, the position of the text-object is calculation correctly.

qjol
3243
qjol  
you can try tou use XY position ChartTimePriceToXY or calculate it using CHART_WIDTH_IN_PIXELS and CHART_HEIGHT_IN_PIXELS
Tjipke de Vries
6372
Tjipke de Vries  
input double textplace = 25;


//calculation height
   int heightinpixels = ChartHeightInPixelsGet(0,0);
   double textprice = WindowPriceMax()-((WindowPriceMax()-WindowPriceMin())*(textplace/heightinpixels));

day at line

BurkhardWille
176
BurkhardWille  

sorry, but it don't work if I zoom in/out, the text is not on the top.

SYED NAUFAL GADDAFI
1399
SYED NAUFAL GADDAFI  
BurkhardWille:

sorry, but it don't work if I zoom in/out, the text is not on the top.


Have you tried to re-attach?
123
To add comments, please log in or register