Accumulation function problem

Optuma Forums Optuma Scripting Accumulation function problem

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #58943
    AvatarPeter
    • Topics: 25
    • Replies: 21
    • Posts: 46

    I’m using the following script to count new highs over a given period.

    H1=HIGH()>HIGHESTHIGH(BACKTYPE, BARS=22);

    ACC( H1, RANGE=Look Back Period, BACKTYPE, BARS=22) //bar type == close

    When I manually check the counts they are not correct as I want the new highs not new closes.
    If I use this script I just get rubbish answers.

    H1=HIGH()>HIGHESTHIGH(BACKTYPE, BARS=22);
    ACC( H1, RANGE=Look Back Period, BACKTYPE, BARS=22, BARTYPE=High)

    Can someone show me my error.
    Thanks Peter

    Attachments:
    #58947
    MathewMathew
    • Topics: 36
    • Replies: 1,806
    • Posts: 1,842

    Hi Peter,

    Cange your script to this:

    I’m not sure why we even have Open, High Low Close in the ACC function, but changing that was the issue.

    Also, you have a random “BACKTYPE” in the ACC function. It probably would do nothing wrong, but it does not need to be there.

    I always like to break scripts up so I can see how the individual components are working. In this image I have your HIGH()>HIGHESTHIGH(BACKTYPE, BARS=22); as a Show Bar and the whole script above as a Show View. Then I can cast my eye back and see that any time the count at the bottom matches what I am seeing with the Show Bar.

    Hope that helps

    Mathew

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

Pin It on Pinterest