Optuma Forums › Optuma Scripting › First Signal
Tagged: OFFSET
- This topic has 7 replies, 4 voices, and was last updated 9 months ago by
Kim.
-
AuthorPosts
-
April 8, 2022 at 6:51 pm #67911
Thomas
- Topics: 131
- Replies: 183
- Posts: 314
Hi,
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.
Thanks,
ThomasApril 8, 2022 at 7:22 pm #67913Darren
- Topics: 73
- Replies: 923
- Posts: 996
Hi Thomas,
Put the results in a NOREPEAT() function, and set it to 60 bars:
https://help.optuma.com/kb/faq.php?id=1031
1 user thanked author for this post.
April 12, 2022 at 6:44 pm #67923Kim
- Topics: 20
- Replies: 26
- Posts: 46
Hi,
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:
123TIMESINCESIGNAL(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
-
This reply was modified 9 months ago by
Kim.
Attachments:
You must be logged in to access attached files.
April 12, 2022 at 8:51 pm #67929Darren
- Topics: 73
- Replies: 923
- Posts: 996
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:
April 13, 2022 at 12:38 pm #67931Kim
- Topics: 20
- Replies: 26
- Posts: 46
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
Kim
April 13, 2022 at 3:39 pm #67933Matthew
- Topics: 5
- Replies: 653
- Posts: 658
Hi,
You could wrap your entry script in an OFFSET() function to get the result you are after.
For example:
Entry:
1234V1 = MA(BARS=150) CrossesAbove MA(BARS=50);V1Exit:
1234V1 = MA(BARS=150) CrossesAbove MA(BARS=50);OFFSET(V1, OFFSET=22)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.
1 user thanked author for this post.
April 13, 2022 at 5:21 pm #67935Kim
- Topics: 20
- Replies: 26
- Posts: 46
Thanks!!! Appears to work in the back tester too!
April 15, 2022 at 2:58 pm #67947Kim
- Topics: 20
- Replies: 26
- Posts: 46
Just as an FYI, it doesn’t do what I wanted in the Back Tester
-
AuthorPosts
- You must be logged in to reply to this topic.