view the numerical data behind a graph

Forums ProRealTime English forum ProBuilder support view the numerical data behind a graph

Viewing 3 posts - 1 through 3 (of 3 total)
  • #244829

    how do i get this pro real code to show the numerical values as well as producing a chart

     

     

    // Monthly MACD Indicator on Daily Chart
    MACDFastPeriod = 12
    MACDSlowPeriod = 26
    MACDSignalPeriod = 9

    // Switch to monthly timeframe to calculate MACD
    TIMEFRAME(monthly)
    imacd = MACD[MACDFastPeriod, MACDSlowPeriod, MACDSignalPeriod](close)
    normalizedMACD = imacd / close

    // Back to default (daily) timeframe
    TIMEFRAME(default)

    RETURN imacd AS “Monthly MACD”, normalizedMACD AS “MACD/Close”

    #244830

    Hi,

    If wanting to see the value anywhere, and cursor details are not showed, you can go in the platform settings in the main window menu to activate them.

    If wanting instead to display latest value on chart, rather than reading it inside the right side margin or in the cursor details, you can use the DRAWTEXT command, alongside drawonlastbaronly set on true. For example in green the added lines to try out, but you can change the drawtext parameters to display text somewhere else more convenient:

    defparam drawonlastbaronly=true

    // Monthly MACD Indicator on Daily Chart
    MACDFastPeriod = 12
    MACDSlowPeriod = 26
    MACDSignalPeriod = 9

    // Switch to monthly timeframe to calculate MACD
    TIMEFRAME(monthly)
    imacd = MACD[MACDFastPeriod, MACDSlowPeriod, MACDSignalPeriod](close)
    normalizedMACD = imacd / close

    // Back to default (daily) timeframe
    TIMEFRAME(default)

    DRAWTEXT(“NormalizedMACD #normalizedMACD#”, barindex, normalizedMACD)

    RETURN imacd AS “Monthly MACD”, normalizedMACD AS “MACD/Close”

     

    For reference:

    https://www.prorealcode.com/documentation/drawtext/

    https://www.prorealcode.com/documentation/drawonlastbaronly/

     

    1 user thanked author for this post.
    #244831

    Many thanks. is it possible to export straight to a text file

     

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

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