Problems using drawonlastbaronly parameter

Forums ProRealTime English forum ProBuilder support Problems using drawonlastbaronly parameter

Viewing 4 posts - 1 through 4 (of 4 total)
  • #221018

    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.

    Thank you.

    #221022

    Yes because 080100 bar is in the past, and not the current BARINDEX anymore, and that’s what you want draw on last barindex only.

    So the workaround is to store the number of the 08:01:00 barindex and plot it in the past:

    #221065

    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?

    Thanks for your help.

    #221085

    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! 😉

     

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login