Signal Test for returns between first and last signal

Optuma Forums Optuma Scripting Signal Test for returns between first and last signal

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #68587
    Deepak
    • Topics: 85
    • Replies: 71
    • Posts: 156

    Hii Sir,

    Rather than using fixed day period i want to calculate the returns between first and last signal.

    Which means lets say first 52 week low, i am able to find first signal using below script. But i am stuck how to find the last signal after v4. If i am able to calculate the same using a script i will be able to use it in signal tester or back tester to find out returns.

    Also in order to clearly explain i have attached screen shot using chart. In the attached chart i want to find the script for red circled bar after the show bar in each case and then find the returns rather than a constant time period.

    #68617
    Matthew
    • Topics: 5
    • Replies: 631
    • Posts: 636

    Hi,

    Looking at your script and screenshot, can you confirm that you want to measure the difference in price from the first instance the Low crosses below the Donchain lower band, to the last instance the Low crosses below, then reset the measure after the High crosses above the upper band?

    Using the code in your screenshot, the first trigger is on Sep 11 2008, there are 5 more lows crossing the lower band before the high crosses above the upper band on October 29 2010.

    The last instance before that cross is Sep 6 2010, which is different to the area you marked on the chart.

    Ex4

    If you were wanting to measure the area you marked on the chart you would need to specify a rule that works for that scenario, something that could be scripted as a triggering criteria.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest