Indicator value on chart

Forums ProRealTime English forum ProBuilder support Indicator value on chart

Viewing 15 posts - 1 through 15 (of 21 total)
  • #168841

    Hello Gents,

    I am relatively new here. I have a fairly simple and general question.

    If my Indicator returns a value (for example 100), is it possible to show that value directly on the chart (above or below the last bar)?

    If possible, what is the syntax that I can use to achieve this?

    Thank you in advance.

    Regards

    #168851

    Data RETURNed are plotted every bar and this cannot be changed.

    You can plot data using a DRAW…. (see graphic instructions at https://www.prorealcode.com/documentation/category/graphical/), with which you can use DEFPARAM DRAWONLASTBARONLY=TRUE to plot only on the last candle only.

     

     

    #168853

    Thanks Robert.

    So how would I show the value of my indicator directly above or below the current bar?

    For example a simple VWAP indicator returning 5000. How would I put that 5000 number directly above the current bar?

    #168859

    Add this line as first line:

    then add this one before RETURN (I assume your data is retained by variable VWAP, but it can be anything else):

    remove any data after RETURN.

    #168890

    Thank you Rob. It worked. The # did the trick 🙂

    #168891

    How do I increase the font of the text?

    #168892

    You can add Font, Style and Size, as best described at https://www.prorealcode.com/documentation/drawtext/.

     

    #168896

    Excellent thank you.

    I have the chart on 15 mins intraday and the vwap value resets every 15mins when a new bar forms (which is what i want it to do).

    Now how would I leave a copy of the value on the previous bar as soon as the new bar forms? is there a trick to do this?

    #168897

    for example, how would I define the last second of a bar? for example 14 mins and 59 seconds (on a 15 min bar)?

    #168918

    To plot the last two values, since it always plots on the last bar, deleting what’s been plotted before, you have to save the previous bar’s value of the indicator.

    The first line after DEFPARAM must be:

    then use two separate DRAWTEXT lines:

     

     

    #168927

    As to your last question, this is an indicator to be added under your 1-second price chart:

     

    #168936

    Thank you Robert. Much appreciated.

    Assume my indicator is calculating difference between two numbers (say a-b=c). Now is c is being continually calculated and is dynamically changing on the chart.

    Now let’s say c happens to be < 0 (say for argument sake = -100). Now as long as c is decreasing is value (eg -105, -107, -109 etc…) I keep on colouring c in red. But when c increases in value say switches from -105 to -103 (notice c is till <0 but increased in value), how do I then show it in green?

    #168942

    There you go (not tested):

     

    #168949

    Tnx but your code is looking at a value 1 bar ago i.e. mycci[1]. The two values I need to compare are both occurring in the current bar (1 variable dynamically changing in the current bar so it need to compare it to itself ( i.e. its currentvalue – its previous value) …so I need something else other than [1] syntax

    #168955

     

Viewing 15 posts - 1 through 15 (of 21 total)

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