Help to find Highest and Lowest value between two trade signals

I am using WMA cross as a signal to Buy and Sell.

WMABuy 	= Cross	(WMAFast, WMASlow);
WMASell = Cross	(WMASlow, WMAFast);

I'd like to detect and output the lowest and the highest values which occurred between WMABuy and WMASell.
As I understand I could use HighestSince(WMABuy, High) just not sure how it should be done in this situation. As I only need the latest period (there are many signals, but I want this data in real-time)...

Any tips or pointers would be highly appreciated.

See if this post by @fxshrat helps
You can change EMA to WMA and will be ready.


Thank you @travick
I have been "dancing" around the problem by using HighestSince, ValueWhen and LastValue, but I've done it in a wrong way.
The arrays still give me a trouble even several months into afl learning.
And pardon me creating an almost exact topic with a question which was already answered before (I couldn't imagine someone will have the same situation, so been searching other phrases).

1 Like

Just be cautious in the application as ValueWhen() is used with 0 as lookup instead of 1 which is default, that means it looks into the future.

Fx has already mentioned that, but many other such functions give this ability which should be used judiciously.


Hi @travick and @fxshrat...

I have a strategy which contains Buy/Short signals. I want to analyse the HHV and LLV to define accurate SL and TSL after analyzing last 10-years data.

Is there anyway I can use this solution to find out HHV and LLV between all buy/Short signals with additional column named HHV and LLV for further analysis.

I am asking the question here as similar topic shows CLOSED for reply.