Intraday Seasonal Indicator

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #123794 quote
    Ivan Donatiello
    Participant
    Average

    Hello everyone, it’s been a while since I haven’t written here but today I have to propose something that could be useful for everyone.

    I want to make an indicator that says hourly intraday seasonality, throughout the week. Like Larry Williams’, I attach the image.

    Do you believe it is possible to create something like this?

    #123799 quote
    Vonasi
    Moderator
    Master

    This is only really a practical proposition in v11 where we now have arrays. It could be done in v10.3 but would involve an awful lot of repetitive coding and would be quite slow to draw I believe.

    At the moment I only have end of day data in v11 so I can’t help with anything on hourly charts on there at the moment and I’m not sure that I want to get involved in a massively repetitive v10.3 code right now!

    Nobody thanked this post
    #123802 quote
    Vonasi
    Moderator
    Master

    Here is an example of how it could be done in v10.3. I’ll let you fill in the remaining 1160 odd lines of code and then error check it! It would just be a few lines of code in v11 with arrays.

    defparam drawonlastbaronly = true
    
    if openhour = 1 and opendayofweek = 1 then
    h1d1 = h1d1 + (close - open)
    h1d1count = h1d1count + 1
    h1d1avg = h1d1/h1d1count
    endif
    
    if openhour = 2 and opendayofweek = 1 then
    h2d1 = h2d1 + (close - open)
    h2d1count = h2d1count + 1
    h2d1avg = h2d1/h2d1count
    endif
    
    //...and repeat another 166 times
    
    drawsegment(barindex-169,0,barindex-168,0+h1d1avg)
    lastvalue = 0+h1d1avg
    drawsegment(barindex-168,lastvalue,barindex-167,lastvalue+h2d1avg)
    lastvalue = lastvalue+h2d1avg
    drawsegment(barindex-167,lastvalue,barindex-166,lastvalue+h3d1avg)
    lastvalue = lastvalue+h3d1avg
    
    //....and repeat another 165 times
    
    return
    
    #123821 quote
    Vonasi
    Moderator
    Master

    Just to let you know that I got a bit bored so I have started working on the indicator. I have got it working and debugged on the first two days of the week (image attached) and so now it should be a simple find and replace exercise to complete the code and then add some labelling to the axis. I’ve got to do something else now so I will try to complete it later or tomorrow.

    JohnScher thanked this post
    #123845 quote
    Ivan Donatiello
    Participant
    Average

    If you really can do it you’re the best 🙂

    #123852 quote
    JohnScher
    Participant
    Veteran

    Thank you very much.
    I would find the indicator very helpful. Finally, there are some things I could try out.
    I’ll keep looking for it.

    #123853 quote
    Vonasi
    Moderator
    Master

    I found time to finish it.  It works on v10.3 but is slow to calculate so be patient!

    Just an ITF file attached as the code is 2405 lines long so I did not want to post the code.

    You can set a start date if you want to only analyse more recent data. Set it to zero to analyse all data.

    Apply it on the 1 hour chart only.

    Feedback welcome before I submit it to the library.

    Bel thanked this post
    #123856 quote
    Ivan Donatiello
    Participant
    Average

    Sorry Vonasi, with what program can I open the itf file?

    #123857 quote
    Vonasi
    Moderator
    Master

    Save it on your hard drive and then import it into your PRT platform via the indicator window.

    #176395 quote
    JohnScher
    Participant
    Veteran

    Hello again, vonasi.

    I am fan of this work here with the seasonal curve of the week. I use it a lot. Some small programs I have written based on this curve.

    Further up in the thread you wrote “Here is an example of how it could be done in v10.3. I’ll let you fill in the remaining 1160 odd lines of code and then check for errors! It would be just a few lines of code in v11 with arrays.”

    I was going to ask you, ask if you could write the few lines in v11. That way we would have a match to see if the curve from v10.3 matches the curve from v11.

    Could you do that for us?

    #176716 quote
    Vonasi
    Moderator
    Master

    Sorry JohnScher but I’m having some time off from coding and moderating at the moment.

    JohnScher thanked this post
    #176797 quote
    JohnScher
    Participant
    Veteran

    Thank you for the feedback.

    #232607 quote
    Nobody
    Participant
    Veteran

    Ive written this one and will get back to you when i come back from holidays

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

Intraday Seasonal Indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 12 replies,
has 3 voices, and was last updated by Nobody
1 year, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/29/2020
Status: Active
Attachments: 5 files
Logo Logo
Loading...