Can you add a general non-time specific note to a chart

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #208007 quote
    Crocogotter
    Participant
    New

    Is it possible to add a note to a chart that isn’t time specific, so that it is always visible whenever you open the chart?

     

    Basically I’d like to have reminders or notes about a chart whenever I open it, say at the top of the chart? It seems a basic function, but I can’t work out how to do it.

     

    Many thanks in advance.

    #208008 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    you can use these added instructions last year using screen pixels:

    New drawing instructions: anchoring in pixels

    Crocogotter thanked this post
    #208010 quote
    Crocogotter
    Participant
    New

    Many thanks for such a speedy reply; that looks to be what I’m looking for 👍.

    #208013 quote
    Crocogotter
    Participant
    New

    I’ve had a look at that, and I think it will help, if I can get it to work.

    Could you explain, or preferably illustrate, exactly the code to get the text to appear please? I understand the various definitions, but am unsure how to get the text on the screen in the first place.

    #208014 quote
    JC_Bywan
    Moderator
    Master

    If you take second post from Nicolas in that link, number #190103 the second example and its explanation is a good illustration:

        Write the word “test” 50 pixels to the right and 30 pixels higher than the bottom-left corner of the graph.

    drawtext ("test", 50 ,30) anchor(bottomleft)

     

    As you talked about the top, similarly you can use the middle-top as anchor, and use negative pixel value on vertical axis to go below top edge :

    drawtext ("test", 0 , -30) anchor(top)
    #208015 quote
    Crocogotter
    Participant
    New

    I understand that, I just don’t understand where I use it; I tried to create an indicator with that code but it didn’t work, and I’m otherwise at a loss I’m afraid.

    #208016 quote
    JC_Bywan
    Moderator
    Master

    I just noticed you posted in “platform support” forum, I’ll move shortly this topic to the forum specific to custom indicators: the “probuilder forum”. This recommendation for forum use and a few others may be found in the yellow background box at bottom of this page, please have a quick look if not familiar with them, thanks.

    List of all available forums to route topics: https://www.prorealcode.com/forums/

    #208018 quote
    JC_Bywan
    Moderator
    Master

    Ok, you need to click on the indicators button, either at top of chart if using PRT v12 (or even the good old v10.3), or at bottom left if using PRT v11. And there, instead of the simplified creation window, you need to use the creation by code, not forgetting the traditional “return” line at the end of the script.

    Then you give your indicator a name, execute it, save it, it should appear as a separate window below price window. After it’s saved, it is now available in your indicators list. Then you need to add it to your price window, if you haven’t done it before, here is how in 1mn video:

    https://www.prorealcode.com/blog/video-tutorials/how-to-add-an-indicator-on-price-prorealtime/

    drawtext ("test", 0 , -30) anchor(top)
    
    return
    Crocogotter thanked this post
    #208020 quote
    Crocogotter
    Participant
    New

    Sorry, was a bit out of practice with my coding, it’s working now thanks.

    #208026 quote
    Crocogotter
    Participant
    New

    One last question, I have tried the search function but without success I’m afraid.

     

    Is there a way of reading the chart name (eg the particular stock or forex pair) and using that to add a specific text message for that stock with a simple

    if NAME = “TSLA” then

    drawtext (etc)

    endif

    #208046 quote
    robertogozzi
    Moderator
    Master

    It’s not possible for code to read the chart. Additionally, the sole data type supported is the floating point numeric type.

    #208079 quote
    Crocogotter
    Participant
    New

    Ok, thanks.

     

    Might that be something to consider for future versions or would the structure of the charts mean it will never happen?

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

Can you add a general non-time specific note to a chart


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 11 replies,
has 3 voices, and was last updated by Crocogotter
3 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/23/2023
Status: Active
Attachments: No files
Logo Logo
Loading...