Barindex Value

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

    Hello,

    Is there a way to retrieve the barindex  value of the last bars loaded .

    I need it in order to draw a segment from 000000 to actual time .

     

    Giovanni

    #23278 quote
    Nicolas
    Keymaster
    Master

    This is something I need too.

    But, while loading the history for the first time, the last current bar is always “BARINDEX”, but we have no possibility to know if this barindex is currently the real actual LIVE one (current time I mean.. hope it makes sense?).

    #23365 quote
    H_Miller
    Participant
    New

    Thanks Nicolas,

    I did it this way and it works except that the segment is not automatically refreshed on a new bar.

    // defparam drawonlastbaronly = true
    REM Current time add 1 hour due to timezone difference
    REM x1= barindex at time 000000
    if time=CurrentTime+010000 and date=today then
    lastbarindex=barindex
    vDopen=Dopen(0)
    DRAWSEGMENT(x1,vDopen,lastbarindex,vDopen) coloured(0,0,255,255)
    endif
    #23370 quote
    Nicolas
    Keymaster
    Master

    Well done, your code is clever.

    What is the purpose of “+010000”?

    Did you try with this condition instead?

    time>=CurrentTime+010000
    #23399 quote
    H_Miller
    Participant
    New

    Fantastic Nicolas!

    I tried your code and now the segment is refreshed!

    I am adding +010000 because ProrealTime  is installed on IG UK while  my computer  is in Germany (I work in Remote Deesktop) and there is one hour difference.

     

    Thank you very much!!!!!!!

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

Barindex Value


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

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

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