First Signal


I try to script a signal where the tool moves above a selected threshold e.g. 10. That can easily be done with the function “CrossesAbove”.

But when the tool move above 10 and a few days later moves below 10 and than again moves above 10 I get TWO signals within a very short period of time.

Is there a way that I get only ONE signal when the tool moves the FIRST TIME above 10?

I think I have to choose a period of e.g. 60 days if only the signal of the FIRST TIME when the tool moves above 10 should be used. After the period of 60 days, a movement above 10 is a real new signal.

I have tried with “TIMESINCESIGNAL” and “SIGNALAFTER” but was not successful.


Hi Thomas,

Put the results in a NOREPEAT() function, and set it to 60 bars:


I’ve been having a similar problem that I haven’t been able to solve using NOREPEAT.

In the image below, each yellow line represents my entry signal. In the bottom panel, the green areas represent my exit signal. I’m looking to add a time exit so that if there isn’t an exit signal within 20 bars of the entry I exit the trade. I’ve tried to do this (represented by the dotted blue line) using the same code used to produce the entry signal plus:

TIMESINCESIGNAL(EntrySignal, UNIT=Bars) == 22 ;

As you can see, the time exit only shows when there are no entry signals for, in this case, 22 bars.

Ideally I’d like to be able to add the time exit to the Back Tester as an “OR”, but if that’s not possible just showing the time signal on a chart 22 bars after each entry signal would be great!

Many thanks

Hi Kim,

I can’t think of an easy way using a Show Bar because every time there’s a new entry the time count starts again. However, in the Backtester you can set the Max Hold Days to 31 calendar days (ie approx 22 trading days) so the trade will be automatically exited if the signal isn’t hit before then:


You may also be interested in our quantitative Signal Testing add-on module which takes entry signals and shows the average performance over time. The Trade Tester component also allows you to add an exit signal. For more details (including videos) please see here:

Signal & Trade Tester KnowledgeBase

Hi Darren,

I’m using Optuma 2.0 Build 99, Trader Services and can’t see the option for maximum hold days, see screenshot below. Is it only available on certain subscriptions? It would definitely be helpful to have that option!

By the way, I already have the Signal Tester module. It’s definitely useful but nothing allows me to do a “true life” test of my strategy. Perhaps when the re-write of the back tester is released?

Thanks again


Back Test


You could wrap your entry script in an OFFSET() function to get the result you are after.

For example:


V1 = MA(BARS=150) CrossesAbove MA(BARS=50);


V1 = MA(BARS=150) CrossesAbove MA(BARS=50); 

This would not reset if a new cross happens within the 22 bar period.


With your other query, you are correct, some of the properties in the Back Tester (such as Minimum Hold Days / Max Hold Days) are part of the Enterprise services subscription only.

Thanks!!! Appears to work in the back tester too!

Just as an FYI, it doesn’t do what I wanted in the Back Tester