Price Range Script Error

Optuma Forums Optuma Scripting Price Range Script Error

  • This topic has 9 replies, 3 voices, and was last updated 6 months ago by Tim.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #67725
    Tim
    • Topics: 25
    • Replies: 23
    • Posts: 48

    Hi,

    I’m trying to use this script to scan for prices that have moved less than 10% in the last 10 bars.

    However it is returning price ranges up to 20%

    Tim

    #67727
    Matthew
    • Topics: 5
    • Replies: 631
    • Posts: 636

    Hi Tim,

    I would calculate the Daily % Range, then use BarsTrue() to find where it was less than 10% over the last 10 days.

    Script Example:

    If you mean has moved less than 10% over the entire 10 day period (not on a daily basis) a ROC would work.

    • This reply was modified 6 months ago by Matthew.
    #67731
    Tim
    • Topics: 25
    • Replies: 23
    • Posts: 48

    Hi Matthew,

    Thanks. I didn’t occur to me to work it out on a bar by bar basis.

    Tim

    #67733
    Tim
    • Topics: 25
    • Replies: 23
    • Posts: 48

    Hi Matthew,

    I’m still getting a few outside <=10.

    Please see attached workbook.

    Tim

    #67737
    Matthew
    • Topics: 5
    • Replies: 631
    • Posts: 636

    Hi,

    The ROC() uses Close only to compare. Are you wanting to include High and Low ranges within the scope of % movement over that 10 day period?

    #67743
    Tim
    • Topics: 25
    • Replies: 23
    • Posts: 48

    Hi Matthew,

    I’m trying to scan for “consolidation patterns”.

    Number of bars, say 20, that are trading in a price range, say less than 10%.

    I’ve attached an example.

    Thanks,

    #67755
    Darren
    • Topics: 70
    • Replies: 873
    • Posts: 943

    Hi Tim,

    This will calculate when the percentage difference between the 10 day high and low is less than 10%:

     

    #67763
    Tim
    • Topics: 25
    • Replies: 23
    • Posts: 48

    Hi Darren,

    Thanks – that’s the calculation I was looking for.

    However when I run the script in the Scanning Manager I am still getting some results outside the 10%.

    See attached Daily Chart.

    I must be making a mistake with the Scanning Manager.

    The settings I am using are ASX All Ords/Current Membership/Date Range – Last Week/Date Timeframe- 1 Day/Display – Latest Match.

    #67767
    Matthew
    • Topics: 5
    • Replies: 631
    • Posts: 636

    Hi,

    Apply V1 and V2 to your charts using a Show Plot and you will see why the result is being returned.  Highest High and Lowest Low values are dynamic, what covers a 10% range today may be different to the 10% range 5 days ago.

    If you are only using the script to scan with (don’t need historical matches) you could wrap V1 and V2 in a LAST() function, this should give you the result you are expecting.

    #67801
    Tim
    • Topics: 25
    • Replies: 23
    • Posts: 48

    Hi Matthew,

    By applying the variables as a Show Plot I can see what you are saying and the difference when using LASRT().

    Thanks.

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

Pin It on Pinterest