performance to trough

Hi

I tried to have a script for the calc of the performance from any given point in time to the trough of the time period to date. So for example from beginning of March 2020 to the trough of March to date . I tried to print the closing price of the first trading day of March (where I still struggle a bit) divided by the trough (which already is handy available). Any hint or smooth, easy way to have it accomplished? thank you!

best,

Thomas

Thanks Thomas. The following will calculate the performance from the close of the first trading day in March (2nd) to the lowest low value over the last 20 days. Is that what you had in mind?

//Get starting value;
M1 = VALUEWHEN(BARDATE()==STRDATE(DATE=2020-03-02));
//Get 20 day low value;
L1=LOWESTLOW(BARS=20);
//Calculate % change
(L1-M1)/M1

In this example BA fell 69.2% from March 2nd to the low on March 18th:

Capture