Monthly High Low Close Indicator

Forums ProRealTime English forum ProBuilder support Monthly High Low Close Indicator

Viewing 15 posts - 31 through 45 (of 50 total)
  • #95537

    Sorry, I’m new to Proraltime and couldn’t imagine that this so dificult in the software.

    #95543

    With arrays it would be no problem to get monthly , weekly , daily OHLC  but without arrays its not so easy.

    1 user thanked author for this post.
    #95560

    This might help:

    It recognises the start of a new week (even if it is not a Monday) and the start of a new month and starts recording highs, lows, open and close. At the start of every new week and new month it records the previous weeks/months values.

    #95582

    I just realised that my code in the last post starts the week at the open of the first weekly candle from Monday onwards when it should really be the Sunday candle onwards as this is when a week actually starts trading.  Just change line 1 to:

     

    #95601

    thanks @vonasi, now the big problem  is this: lets say I am on a lower TF chart , how to get the weekly / monthly OHLC from N  weeks /months ago ?

    #95604

    how to get the weekly / monthly OHLC from N  weeks /months ago ?

    By creating our own index that updates whenever a new month or new week start is detected and then searching back using a FOR NEXT or WHILE WEND loop this should be possible. I will try to code something – lunch first though!

    #95609

    Easier to separate it into two indicators – a weekly one and a monthly one.

    weeklookback is the variable for how many weeks you want to look back (1 = last week, 2 = two weeks ago). monthlookback in the monthly version.

     

    1 user thanked author for this post.
    #95614

    Wow, amazing code @vonasi !

    I just moved the second IF  inside the first IF block and it seems to run faster. In fact we only need to check past OHLC data when month or week changes, not on every bar.

     

     

    #95617

    Well spotted pableitor. In my defence I did code it while eating lunch as I was too impatient to get started on it!

    Glad you like it – although I’m not sure what use there is in knowing what the OHLC was several months ago? Personally I’ve never found previous OHLC levels to offer any support or resistance of any worth but I’m willing to be proved wrong.

    #95626

    Here is a minor improvement that gets rid of the problem of values being zero until the first new week or month has been recognised. They are now all equal to close and not drawn on the chart. I’ve added some colour too.

     

     

    #95658

    Thanks a lot – I will also try this!

    #156871

    One of the codes posted in this thread works fine on prt v 10.3 but not on v11.1.

    I am displayed with the error ‘A positive integer field is expected with highest’ message

    Thanks

     

    #156875

    Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.

    Thank you 🙂

     

    #156882

    MacroT – Try this:

     

    #156892

    Thank you – that worked

Viewing 15 posts - 31 through 45 (of 50 total)

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