Optuma Forums › Optuma Scripting › Signal Test for returns between first and last signal › Reply To: Signal Test for returns between first and last signal
- Topics: 5
- Replies: 616
- Posts: 621
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.
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.