% Rise or Fall

Optuma Forums Optuma Scripting % Rise or Fall

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #58401
    AvatarAndrew
    • Topics: 20
    • Replies: 43
    • Posts: 63

    Evening

    I want to shade a chart wherever there has been a % rise or fall in price over time (like areas identified manually below except shading over full view).

    DJI -50% Fall

    Lets say I want to identify all periods in DJI history where the market has corrected > 50% over a 3 year period.

    I’ve have been working with the scripting below without the result I expect. Would it be possible to capture a rise and then further 50% fall in the same 3 year period if it were to occur or does that require the grunt of pascal programming…?

    Thanks for any guidance.

    Andrew

     

    #58407
    MathewMathew
    • Topics: 28
    • Replies: 1,373
    • Posts: 1,401

    Hi Andrew,

    Think about this as two scripts which are combined in a SWITCH function. Then you need to think about the conditions to turn on the switch and the conditions to turn it off again.

    In your script just make “Show”  line into V3 = %D CrossesBelow -50;

    Then you can use a Switch(V1, V3) function.

    https://help.optuma.com/kb/faq.php?id=724

    Hope that helps

     

     

     

     

    • This reply was modified 1 month ago by MathewMathew.
    #58555
    AvatarAndrew
    • Topics: 20
    • Replies: 43
    • Posts: 63

    Morning guys – I’m still trying to achieve the outcome I am after with this script. Grateful if you could help me understand why the 50+RISE script in the attached workbook is signalling on 18 Mar 1907 ?

    Ultimately I am looking to identify the periods where the market has increased by 50% or more from the LL for a defined period, in this script currently 3 years. I want to get to something like the image attached (50+ RISE goal).

    Grateful for any assistance or more of a guide in the right direction here.

    Cheers
    Andrew

    Attachments:
    #58569
    MatthewMatthew
    • Topics: 4
    • Replies: 269
    • Posts: 273

    Hi,

    When your script is broken down to show the %D plot with a Horizontal Line at 50, you will see that on the date in question the line jumps just above 50, and so the criteria is met.

    Ex2

    Based on this it seems to be working as expected.

    #58593
    AvatarAndrew
    • Topics: 20
    • Replies: 43
    • Posts: 63

    Thanks Matthew, I located my error.

    It has been suggested that I work with the SWITCH function, how do I identify v3 trigger and then lookback to where v1 initiated to shade that area?

     

     

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

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close