Indicate result only if it hasn't already occured in previous period

Optuma Forums Optuma Scripting Indicate result only if it hasn't already occured in previous period

This topic contains 5 replies, has 4 voices, and was last updated by Darren Darren 3 weeks, 1 day ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #54661
    Avatar
    Andrew
    • Topics: 10
    • Replies: 15
    • Posts: 25

    Hi all

    I wondered if someone couldn’t give me a nudge in the correct direction here. I use the following to identify a period when there are three higher closes in my market of choice

    CLOSE(OFFSET=2)<CLOSE(OFFSET=1) AND CLOSE(OFFSET=1)<CLOSE()

    How might I limit the results so that the above is only indicated so long as it had not also occurred in the previous 7 TD’s for example?

    Thanks in advance for any help with this.

    Cheers

    Andrew

    #54663
    Mathew
    Mathew
    • Topics: 16
    • Replies: 1,057
    • Posts: 1,073

    Hi Andrew,

    Put your script into a variable – it does not matter what you call it. Remember the semi-colon at the end

    Then use the NoRepeat function on that variable set to 7 bars (or 5 if you want trading days). See here for more help https://help.optuma.com/kb/faq.php?id=1031

    v1 = CLOSE(OFFSET=2)<CLOSE(OFFSET=1) AND CLOSE(OFFSET=1)<CLOSE();

    NoRepeat(v1, BARS=7)

     

    Another tip. You could change your line to be this

    v1 = CLOSE()[1] IsUp AND CLOSE() IsUp;

    That is telling Optuma the previous bar needs to be a higher close and the current bar needs to have a higher close.

    Hope that helps

    Mathew

     

     

    1 user thanked author for this post.
    #54677
    Avatar
    Andrew
    • Topics: 10
    • Replies: 15
    • Posts: 25

    Hi Mathew

    I’ve been experimenting with this today, I get numerous vertical lines on my chart if I use

    CLOSE(OFFSET=1) IsDown and CLOSE() IsDown

     

    however when I add the norepeat variable as follows I get no vertical lines

    V2 = CLOSE(OFFSET=1) IsDown and CLOSE() IsDown;

    NOREPEAT(v2, BARS=7)

     

    If I add a MA variable as below my vertical lines reappears

    v2 = CLOSE(OFFSET=1) IsDown and CLOSE() IsDown;

    NOREPEAT(v2, BARS=7) and CLOSE()<MA(BARS=7)

     

    What am I overlooking with the second script here?

    Cheers

    Andrew

    #54681
    Matthew
    Matthew
    • Topics: 4
    • Replies: 190
    • Posts: 194

    Hi Andrew,

    I can’t repeat the issue you’re seeing.  When i use the script posted in your reply this is what i get:

    Ex1

    I’m not sure if there’s more to your script and you’re only posting a part of it, but from what i can see it’s working as expected.

    I’ve attached an example workbook as well, download it and try it on your copy of Optuma, if you continue to have problems attach the full script and perhaps a sample workbook of the issue you’re seeing and i can look at it further.

    Attachments:
    #54715
    Avatar
    Andrew
    • Topics: 10
    • Replies: 15
    • Posts: 25

    Hi guys – apologies for the delay. Please find attached my workbook for review – still not sure why its not working as Matt’s does ?

    Grateful for any direction here.

    Best wishes

    Andrew

    Attachments:
    #54743
    Darren
    Darren
    • Topics: 42
    • Replies: 288
    • Posts: 330

    Hi Andrew,

    It appears that you are using your own data source which we do not have access to. We are only able to provide support to clients with an active subscription, but if you would like to arrange a consulting session please let us know.

    Consultations

Viewing 6 posts - 1 through 6 (of 6 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