Hello, this code draws two things. On the one hand, a vertical line at 8 in the morning. And on the other hand, a line with the maximum value of the price the previous day, said line has a text that has to be displayed on the right side of the graph.
The problem I have is that the text I put on the line, which says “Maximum PD”, so that it appears at the end of the line (to the far right), I must activate “defparam drawonlastbaronly=true”, and when I do That’s it, the vertical bar disappears.
I have tried disabling “defparam drawonlastbaronly=true” but then the text does not appear correctly.
How can I get both things to appear correctly? Can you help me?
Note: For me it is important that the text always appears on the right side, since by testing, I managed to put it on the left, but that solution does not work for me.
Thanks for the response, but it doesn’t solve the problem.
With the code you suggested, I only see the elements drawn in the last session and that is not what I want. What I want is for the different elements to be seen correctly for each session, that is, for them to be drawn every day.
I take a couple of screenshots, one with the parameter activated and another deactivated.
How could we fix it, so that all elements look correct every day?
With the code you suggested, I only see the elements drawn in the last session and that is not what I want. What I want is for the different elements to be seen correctly for each session, that is, for them to be drawn every day.
I have fixed the code you provided, to be shown correctly on the current day. You did not asked it to be plot over all history 🙂
But anyway, if you don’t want objects to be drawn continuously on each single bar, then you have to plot them only one time and from the current bar only. So in order to do that, we have to store all coordinates of all objects of history, and that’s easy with an array:
The below version should make you happy, I hope so! 😉
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
defparamdrawonlastbaronly=true//we will draw only from the current bar, but in the past