DayOfWeek-Names vertically at the top

 

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

 
 
Google?
 
BurkhardWille:

Did you search the Codebase ?
 
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.

 
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);
              }
           }
        }
 

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.

 
you can try tou use XY position ChartTimePriceToXY or calculate it using CHART_WIDTH_IN_PIXELS and CHART_HEIGHT_IN_PIXELS
 
input double textplace = 25;


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

day at line

 

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

 
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?
Reason: