Current Daily Bar within one third of the 250-days low

Forums ProRealTime English forum ProBuilder support Current Daily Bar within one third of the 250-days low

Viewing 5 posts - 1 through 5 (of 5 total)
  • #126934

    Hello Pro Real Code community,

     

    I am writing an indicator to show me a Yes/No on whether the current candle is within one third of the yearly low. The year is defined as the 250 days prior to the current candle.

     

    The following code shows how far I have gotten, but for every stock it returns “0” though I know that many of those stocks are within one third of the 250-days low.

    Any chance we can find out wherein the problem lies?

    #126949

    For a starter

    should be

    I would code it like this (not tested):

     

    #126986

    In response to your message Vonasi, I have put together the following:

    Unfortunately, the indicator always returns “0”, even testing it on stocks at their 52-week lows. Any further ideas on what we may be missing here?

     

    Could it be related to this line?:

    Perhaps the dates are not expressed properly.

     

    #126993

    Sorry – I shouldn’t try to count backwards in code after a couple of drinks!

    This works and is much faster:

     

    #127176

    Indeed it does work as intended!

     

    Your help has been of great use Vonasi. Thank you. May you have strength in these global moments of difficulty.

     

Viewing 5 posts - 1 through 5 (of 5 total)

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