2nd derivative test for volume

Forums ProRealTime English forum ProScreener support 2nd derivative test for volume

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

    Good day, I hope you are having a great weekend.

    Has anyone seen anyone making an indicator or scanner with the second derivative test of preferably volume ( if not, its price is ok too)? The second derivative test is basically the slope of the slope. It is a similar relationship to acceleration and speed.

    Rough concept code will be like this:

     

    Reference:

    https://www.khanacademy.org/math/ap-calculus-ab/ab-diff-analytical-applications-new/ab-5-7/v/second-derivative-test

    https://www.youtube.com/watch?v=G8GAsYkZlpE

    #178574
    JS

    <u>FD First derivative (slope)</u>

    FD = Close – Close[n]

    When FD = 0 then there is a relative maximum or minimum value.

    <u>SD Second derivative (slope of the slope)</u>

    SD = FD – FD[n]

    When FD = 0 and SD < 0 then there is a relative maximum value.

    When FD = 0 and SD > 0 then there is a relative minimum value.

    1 user thanked author for this post.
    #178576

    Line 1 will almost never return 0, so lines 4 and 6 will almost never be true.

    Could lines 4 and 6 be  If FD <> 0 and  ?

     

    #178580
    JS

    Seems to work fine but you can use “round” if you like…
    FD must be equal to zero because at this value there is a relative max. value or relative min. value.

    2 users thanked author for this post.
    #178588

    It works. Thank you 🙂

    #178663

    Thank you very much, Rob and Js!! After using “” If FD <> 0 and  “” I did it!! It is working.

    I still have to clean up the code but here is the progress so far.

    Regarding in the above code, ”  if ProDecend=-1 AND ProCon=-1 AND PubSlope=1 AND ProSlope=-1 then  ” attached picture

    However, is it possible to have advice on how to call previously used if statement condition, please? ”

    I do not want the “P” printed everywhere as attached picture…… I only want the P printed only if the above-mentioned 4 conditions are met.

     

    #178665

    =

    #178668
    JS

    Thank you very much, Rob and Js!! After using “” If FD <> 0 and “” I did it!! It is working.

    I hope you didn’t misunderstand but the first derivative must be equal to zero (FD = 0) otherwise you don’t have a maximum or minimum relative value.
    When FD <> 0 than all other slopes, except zero, will be true (in practice 99% of the slopes are true when FD <> 0)

    1 user thanked author for this post.
    #178672

    Yes, you are right. I fixed it accordingly as you say.

    //////////////profe 2D //////////////////
    SDpro=FDpro-FDpro[1]
    RoundFDpro = round(FDpro,1)
    if RoundFDpro =0 and SDpro > 0 then
    ProCon=-1
    DRAWTEXT(“Vp”,barindex,dis2, Dialog, Standard, 20) COLOURED(255,0,0)
    ElsIf RoundFDpro = 0and SDpro < 0 then
    DRAWTEXT(“A”,barindex,dis3, Dialog, Standard, 20) COLOURED(0,0,225)
    EndIf
    /////////////END 1D 2D //////////////////

    //////////////publi 1D //////////////////
    FDpub=publi2-publi2[1]
    if publi2 > publi2[1] then
    DRAWTEXT(“U”,barindex,-dis4, Dialog, Standard, 20) COLOURED(255,0,0)
    ElsIf publi2 < publi2[1] then
    DRAWTEXT(“D”,barindex,-dis5, Dialog, Standard, 20) COLOURED(0,0,225)
    endif
    //////////////publi 2D //////////////////
    SD=FDpub-FDpub[1]
    RoundFDpub = round(FDpub,1)
    if RoundFDpub= 0 and SD > 0 then
    DRAWTEXT(“V”,barindex,-dis2, Dialog, Standard, 20) COLOURED(255,0,0)
    ElsIf RoundFDpub= 0 and SD < 0 then
    DRAWTEXT(“A”,barindex,-dis3, Dialog, Standard, 20) COLOURED(0,0,225)
    EndIf
    /////////////END 1D 2D //////////////////

     

     

    1 user thanked author for this post.
    avatar JS
    #200589

    Hi Suzu, I’m very interested in this concept. Thank you for sharing. Can you please explain how do you use it? Thanks

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