signal date one day off in watchlist script

Optuma Forums Optuma Scripting signal date one day off in watchlist script

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #60353
    AvatarArthur
    • Topics: 4
    • Replies: 4
    • Posts: 8

    Hey guys

    I am working on a watchlist that tracks signals.

    I want to see the active signal (true/false), signal date, bars since current signal triggered, price when signal triggered and price change since signal triggered. Pretty standard stuff.

    Now for the unstandard stuff. I am looking for signals when 65-day RSI crosses above 51 (bullish) and below 49 (bearish). This creates a gray zone so I am using the Switch function. Maybe there is an easier way and someone can enlighten me.

    I reversed the switch signals to get the signal date to align with the actual signal. Now I have a problem where the signal date is one day too early, which also means there is one extra bar in the bar count and the price is based on the close the day before the signal actually triggered.

    The example shows Ford (F) triggering bullish on the Watchlist on October 1st. On the price chart, RSI65 crossed above 51 on October 2nd, one day later. I tried to add an OFFSET, but it did not work.

    Please advise. Thanks, Arthur

    Attachments:
    #60357
    DarrenDarren
    • Topics: 56
    • Replies: 478
    • Posts: 534

    Hi Art,

    You can take the extra bar off by subtracting 1 from these lines:

    #60359
    AvatarArthur
    • Topics: 4
    • Replies: 4
    • Posts: 8

    Thanks for the input. I don’t think that will work because the UNIT is days, not bars. And the counts do not work when I change the unit to bars.

    Your suggestion triggered another idea. I added an OFFSET to the SWITCH functions to make the adjustment at the source signal and this seems to work.

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