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

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

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

 

 

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

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:

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.

V1.owb (10.7 KB)

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

Review.owb (9.48 KB)

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.

https://www.optuma.com/consults/