[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 992

 
MikeZTN:
And I want to get the following: there is a horizontal ray-level, I want his value (price) is displayed as a text marker on the right border of the screen

Alternatively, calculate the coordinate of the rightmost visible bar and set the text label to this value, the value by Y is calculated from the properties of the beam, generally without loops

here's an example of how to calculate this very coordinate

a piece of code which is responsible for finding the right zero coordinate

   datetime ZeroX=Time[0]+60*Period()*(WindowBarsPerChart()-WindowFirstVisibleBar()-1);
   /*if(WindowBarsPerChart()==WindowFirstVisibleBar())Comment(" 1 ");
   if(WindowBarsPerChart()>WindowFirstVisibleBar())Comment(WindowBarsPerChart()-WindowFirstVisibleBar());
   if(WindowBarsPerChart()<WindowFirstVisibleBar())Comment(" 3 ");*/
   double ZeroY=WindowPriceMax()-(WindowPriceMax()-WindowPriceMin())/4;
   double _ZeroY=WindowPriceMin()+(WindowPriceMax()-WindowPriceMin())/4;
 
MikeZTN:
What I want is this: I have a horizontal beam level, and I want its value (price) to be displayed as a text marker at the right-hand edge of the screen
I was wrong in the wording after all)))
 
sanyooooook:

Alternatively, calculate the coordinate of the rightmost visible bar and set the text label to this value, the value by Y is calculated from the properties of the beam, generally without loops

here is an example of how to calculate this very coordinate

The right bar may also be shifted to the left, i.e. invisible bars -1, -2, etc. should be used.
 
MikeZTN:
It is also possible that the right bar is shifted to the left, i.e. invisible bars -1, -2, etc. should be used.
there in relation to the window boundaries
 
Techno:
There was a mistake in the wording after all)))
But what was it?
 
MikeZTN:
And I want to get the following: there is a horizontal ray-level, I want its value (price) to be displayed as a text marker at the right border of the screen

listen :) dear :) - Why do you need a beam - just do it -

OBJ_HLINE 1 Horizontal line. Uses price as the first coordinate, time is ignored


you will get a horizontal line - and its value - price - will be displayed on the right side of the screen :)

 
Aleksander:

listen :) dear :) - Why do you need a ray? Just do it -

OBJ_HLINE1Horizontal line. Uses price as the first coordinate, time is ignored


you will get a horizontal line - and its value - Price - will be displayed on the right side of the screen :)


1) It doesn't just show the price, it also shows additional text information.

2) Horizontal line is not necessary; for more information, I use OBJ_TREND ray with the OBJPROP_RAY property

 
MikeZTN:
But in what way?
you should have said you needed a label that would display the price of one of the levels
 
Techno:
you should have said you needed a label that would display the price of one of the levels
Yes, you could say that. With the horizontal axis referenced to pixels.
 

So display it on the left side of the screen - what's the difference? - The line will have the price on the right - the message text on the left...

or the beam - but then display everything on the left...

Reason: