Optuma Forums › Optuma Scripting › Relative strength scan using RIC › Reply To: Relative strength scan using RIC
February 3, 2021 at 8:08 pm
#62215
- Topics: 70
- Replies: 829
- Posts: 899
To change the RIC() lookback periods to something other than the default Last Month, Last Quarter, etc you can use this trick to set to something else.
The first line finds the date 10 bars ago (2 trading weeks) which is then used in the second line for the Start_Date= field.
1 2 3 4 |
$A = BARDATE()[10]; RIC(DATESEL=User Defined, START_DATE=$A, INDEX=SPX:WI, ZEROBASED=True) |
You can use this script to build options for all the different time frames you were after by adjusting the value on the first line. So for 6 weeks you’d use a 30 bar (6 x 5 trading days) offset:
$A = BARDATE()[30];
The script can then be used in a Show View tool or Watchlist column: