Recurring Vertical Lines – datetolastbarindex

Forums ProRealTime English forum ProBuilder support Recurring Vertical Lines – datetolastbarindex

Viewing 15 posts - 1 through 15 (of 41 total)
  • #177231

    Hello All,

    Just jumped on PRT and had a quick look – well more than a quick look but I’m short on basic coding skills tbh.

    What I’d like to do is draw in 2 vertical lines:

    8.00am

    9.00am

    I’d like these to be visible on future dates 1sec / tick chart ahead of time.

    Barindex gets the job done in dynamic fashion but it’d like to see future vlines on upcoming periods week in adv. Been drawing them in manually, before the session and it becomes a little tedious!

    Datetolastbarindex gets this done perfectly, many thanks for having this. However I need to modify the code manually (add future dates). I could do this weekly and would be better than nothing but does a param.(code) exist I can add that will draw these periods in, say for the next week or month perhaps ongoing even.

    Please forgive my ignorance on this, it’s baby steps for me right now … 🙂

     

    This is what’s been hacked together so far that works in 1sec interv:

    Cheers,

    INV

     

     

     

     

     

     

     

    #177243

    You can declare variables to be set using the indicator properties (settings), as from my screenshot.

    This is the code (but I suggest that you download the ITF where those variables have already been added):

     

     

    1 user thanked author for this post.
    #177270

    Many thanks Roberto … 🙂

    #177271

    Hi Roberto,

    I’m not sure 100% but the output to scr is the same as the original post.

    I guess I was looking for a bit of code that won’t require me to add dates as we progress through the week manually, the two examples above will cease to plot beyond 2021-09-17 (20210917) for example.

     

    Many thanks again,

    inv

     

     

     

     

    #177272

    I think I got you now.

    This will plot Today’s and Tomorrow’s lines at the given hours (not tested):

    Other days could be added by duplicating the same lines used for Tomorrow’s date (no need to change any of them).

     

    2 users thanked author for this post.
    #177274

    This is the same indicator as above, modified so that it allows to set properties so that the TIMES and the number of DAYS (starting from the current day) can be easily changed.

    To plot only ONE line, just set the same TIME for both.

    Time can be any value from 000000 to 235959 (240000 doesn’t exist, it’s 000000 the next day). I suggest that you always enter 6 digits for the time , despite the leading 0s will then be dropped.

    If you want to stop plotting lines, just use 0 as the number of days (or hide the indicator).

    Importing the attached ITF file will spare you from having to add variables.

    1 user thanked author for this post.
    #177293

    Wow Robert …. exposes my inabilities nicely … !

    I’m going to have a closer look here and see if;

    1) I get how it’s come together and;

    2) see point 1 again … 😉

    I’ll post back over the coming days, might take me a while to get my head around it haha

    Many thanks again.

     

    #177302

    Just letting you know Robert …. calc comes out good, added a third and 4th period for completeness of testing but can’t see that far ahead on 1sec inter., still confident all’s good (the 13th and 14th SEP are there).

    There’s an info message that says some tweaking could improve perf. – it’s specific to my unit count.

    The preview is tiny / blurred below so have posted to imgur too.

    https://imgur.com/a/cBpMu1i

     

    Thanks for the ongoing support!

     

     

     

    #177306

    Post JPG/PNG pics, not links.

    Thank you.

    On very small TFs you can’t go ahead much.

     

    #177352

    Apologies I dropped a .png in but the image was removed upon post – odd.

    Here we go again, hope it survives the process!

    Looks blurry in preview again, it’s only 7kb.

     

    edit: yay, it worked this time .. 🙂

     

     

     

     

    1 user thanked author for this post.
    #177354

    Just a quick one Robert – all okay on the small time frame, not being able to go so much ahead, a few days is all that’s needed. Was nicer this morning to not housekeep the opens and with upcoming sessions / tomorrows already in place, I’ve had time for another espresso .. !

    Not sure if I’ve looked hard enough quite yet to see whether it’ll maintain the “historical” vlines in place (or drop the previous days) – should know more tomorrow and coming sessions.

     

    Thanks again.

    #177359

    Line 1 prevents historical lines from being still in place.

    You can comment it out.

     

    #177368

    When commented out works with up to 30k units. No joy with 100k.

     

    #177411

    This seems to be a limit when calucating bar indexes using dates.

     

    #177418

    As a guess not many would find this useful so it mightn’t be a high priority, having said that, the datetolastbar is newish so could be in the pipe maybe 😉

    For now a hybrid of the two might work in tandem across both longer and shorter timeframes quite well. As humans we also need to interface with what’s in the tool chest.

     

    Many thanks for all the help, have a safe and good one … 🙂

     

     

     

Viewing 15 posts - 1 through 15 (of 41 total)
Similar topics:

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