view the numerical data behind a graph

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #244829 quote
    alejandrocorbut
    Participant
    New

    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 quote
    JC_Bywan
    Moderator
    Master

    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:

    DRAWTEXT

    DrawOnLastBarOnly

    Iván González thanked this post
    #244831 quote
    alejandrocorbut
    Participant
    New

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

view the numerical data behind a graph


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by alejandrocorbut
11 months, 4 weeks ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/11/2025
Status: Active
Attachments: No files
Logo Logo
Loading...