max draw down screener based on close

Forums ProRealTime Deutsch forum ProScreener Support max draw down screener based on close

Viewing 10 posts - 1 through 10 (of 10 total)
  • #79619

    i like to screen shares and to sort those screened out by max draw down. but i fail to write the code as i have no idea how to realise the conditions as described below:

    maxdrawdown = (highest[…](close) – lowest[…](close)) / ( highest[…](close) * 100

    Conditions:

    1. the lowest…close must be occured later than the the highest…close – it shall represent the max. loss risk if the share was bought on highest close in that period
    2. as soon as a new highest…close is reached after a past lowest…close, this becames valid for the maxdrawdown calculation in combination with the lowest…close occured after this new high was reached etc.

    The criteria for sorting shall be the maxdrawdown occured during the last 254 days or 254 weeks.

    I would appreciate your support.

    Thanks in advance.

    Roger

     

    #79633

    Ok, not so easy at first glance.. let me think of it so I can give a try to find you a relevant code.

    #79637

    So basically, you want the max spread between the overall max price and minimum price occurred in the last 254 days? Or do you want to use periods to limit the found highest and lowest prices?

    #79649

    I attached an illustration with some examples.

    What I am looking for is a sorting criteria – i. e. max. DrawDown in the last year, max. Drawdown in the last month etc.

    This is not the period just to calculate highest[period](price) minus lowest[Period](price). In this period serveral DrawDowns may occur – and I just want for each share the biggest / smallest as sorting criteria.

    If its not getting clearer please let me know – than I try to explain it better.

    #79657

    Visually, your chart is clear and I’ve understood what you are trying to get, but how do you find tops and bottoms? Basically what are the green and red arrows?

    #79662

    Looking on the chart I just recognise that it is visually clear to me, but I doesn’t believe, that there could be any mathematical description for it.

    So i try to simplify:

    Top = highest[Period](high)

    Low = lowest … (low) – AFTER the top AND before the next top = between current and next top.

    Any idea if this could be realised?

     

    #79664

    You can give a try with this screener:

    I used Close instead of high, because it was how you explained it the first time, you can change the price serie if you want to.

    And an indicator to confirm the calculation and see how and when the max spread between highest high and the low was found:

     

    #79708

    Great – the indicator does exactly what I intended.

    But not so the screener. The screener just takes into account the “last” maxspread fromm current high to current low. The previous highs / lows are not taken into account.

    #79738

    The screener does the same, always saving the highest maxspread, please verify on stocks that you have a live data subscription (not “End Of Day”). Bear in mind that ProScreener only have 254 bars of history available.

    #79758

    It works.

    Thx a lot

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

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