Max value of an entire Series

Posted By: maxwellreturn

Max value of an entire Series - 07/24/19 18:02

Sorry for my dumb question but it seems simple but it's not confused

How can i get the max value of an entire series? All functions ( statistical or sortData) get the problem of LookBack and Time Period

Ps.im tryng to obtain a current Max Drawdown, so i need a current Max Value of the equity Curve
Posted By: AndrewAMD

Re: Max value of an entire Series - 07/24/19 20:18

You don't need the length. Use a static var. It holds its value between function calls. Alternatively, use an AssetVar or AlgoVar in the same manner.

Code
vars ThisSeries = series(...);
static var maxThisSeries = -999.99; // arbitrary low initial number
maxThisSeries = max(maxThisSeries, ThisSeries[0]);
Posted By: maxwellreturn

Re: Max value of an entire Series - 07/24/19 22:18

perfect, thank you andrew
© 2024 lite-C Forums