Using total return in a script with GETDATA function?

Is there a way to use total return when using GETDATA in a script. I am trying to use the symbol BIL in a RIC script but it does not reflect dividends. Open to suggestions. Thanks, Jamie

Hi Jamie,

You can use the TRET() function to convert the data to Total Return and include the dividends:

You can use this, so $BIL is -17.75% on a Price Return basis over the last year, and -13.61% taking in to account dividends:

P1 = TRET();
RIC(P1, DATESEL=Last Year, ZEROBASED=True)/100

Note that you can set the Watchlist to use Total Returns by default so the TRET() step won’t be required:

Hi Jamie,

When using the RIC() function, Darren’s solution is of course the best.

But you can use the GETDATA() function to use the total return performance of a security.

You simply select “Total Returns” in the GETDATA() property “Price Adjustment”.

screenshot - 0001

1 Like