starting date of graphic

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #225996 quote
    jjk3338
    Participant
    New

    Hi to all,

    I am trying to create a indicator on the price graphic that compare the evolution of one asset (F.E. SP500) with the analysed asset.

    For that, i need to set a variable as the first date of the period i am seeing on the graphic, that depends on how much zoom i do on the history of the asset.

     

    Is it possible to create extract that dynamic date and program accorting to that?

     

    kind regards

    #226003 quote
    robertogozzi
    Moderator
    Master

    Is this what you mean?

    DEFPARAM DrawOnLastBarOnly = true
    IF BarIndex = 0 THEN
       StartYY   = OpenYear
       StartMM   = OpenMonth
       StartDD   = OpenDay
       StartH    = OpenHour
       StartM    = OpenMinute
       StartS    = OpenSecond
    ENDIF
    DrawText("#StartDD##StartMM##StartYY# at #StartH##StartM##StartS#",BarIndex + 5,highest[50](high + range))
    RETURN
    #226006 quote
    robertogozzi
    Moderator
    Master

    Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.

    Thanks 🙂

    #226193 quote
    jjk3338
    Participant
    New

    Sorry, First time using this forum.

     

    The indicator i was hoping  creating was variable depending on the starting date of the graphic, not the historic.

    I try your code (thanks for that) but the value is constant because is always the value of the first date of the historic of the company, not the graphic.

    For example, in the capture, I used the varaible of the year you used in the code,  but the starting date of the graphic is 2012-2013, so i was hoping the variable to get that value.

     

    thank you very much for the asnwer.

    #226197 quote
    jjk3338
    Participant
    New

    I think i solved it,

     

    Thank you very much

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

starting date of graphic


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
jjk3338 @jjk3338 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by jjk3338
2 years ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/05/2024
Status: Active
Attachments: 4 files
Logo Logo
Loading...