Widest range from high to low last 20 days

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #114897 quote
    Dr Manhattan
    Participant
    Senior

    How can I find the widest range from high to low of any the previous 20 days from now? any ideas? it should involve <code>range</code> and <code>summation</code>, or? anyone know how to write it?

    #114899 quote
    robertogozzi
    Moderator
    Master

    There you go

    x = highest[20](range)
    Dr Manhattan thanked this post
    #114900 quote
    Vonasi
    Moderator
    Master
    bigrange = high = low
    
    for a = 1 to 19
    bigrange = max(bigrange,high[a] - low[a])
    next
    
    Dr Manhattan thanked this post
    #114901 quote
    Dr Manhattan
    Participant
    Senior

    Aaaah! always so clear when the answer is there!! 🙂 thanks

    #114903 quote
    GraHal
    Participant
    Master

    Both codes added as Log 189 and 190 here

    Snippet Link Library

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

Widest range from high to low last 20 days


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 4 replies,
has 4 voices, and was last updated by GraHal
6 years, 2 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/14/2019
Status: Active
Attachments: No files
Logo Logo
Loading...