Lowest low/ showbar

I’m having problems writing a script that will show lowest low for x periods including the current bar. If I use the code in a watchlist then

LOWESTLOW(BARS=20, INCBAR=True) works fine. But if I then try to show this bar on my charts using a showbar the script if not valid.

I then tried
//showbar lowestlow for 20 bars LOW() < LOWESTLOW(BARS=20, INCBAR=True)
still no success.Can someone show me where my thinking is wrong.
Thanks Peter

Hi Peter,

Because the low can not be lower than itself on a signal bar you need to either turn off the ‘Include Current Bar’ option or change your formula to LOW() <= LOWESTLOW(BARS=20, INCBAR=True), and then the Show Bar logic will work.

Thanks Darren but still not working. Testing on asx 20, AMC formula in watchlist low 15.12, applied to chart low 14.92. Then ANZ watchlist low 24.82, applied to chart shows bar 42 low. BHP correct but also shows previous low. BXB also not correctand shows numerous previous bars.

Any further thoughts?

The watchlist script is

LOWESTLOW(BARS=20, INCBAR=True) and chart script is as above.

Thanks Peter

 

Hi Peter,

It seems to be working ok here:

V1 = LOWESTLOW(BARS=20, INCBAR=True);
LOW() <= V1

This script will show any bar that hit the lowest low line. When applied using a Show Bar you get the following results (red arrows):

Ex1

The green line is produced from the LowestLow() script in your original post.

If you are trying to achieve something different please provide more information including a screen shot of the setup.

the bar I’m trying to find on the asx chart is 9/1/20 with low of 80.61 as detailed when the script is run in a watch list. The bar you have identified is bar 42 from the current bar. I’m trying to show on the chart what is the lowest low bar counting back from the current bar for a maximum of 20 bars.

I can’t work out how to attach a screen shot full size as in your post.

Hi Peter,

Based on your description you just need to find the last value of the lowest low and find the low that matches that exact value.

V1 = LOWESTLOW(BARS=20, INCBAR=True);
V2 = LAST(V1) ;
LOW() == V2

You may need to make a few adjustments for it to work in every instances (where the low value has occurred multiple times in recent history, etc), however this should give you a good base to build off. Here’s an example image of the script working:

Ex2

Red Arrow is the trigger bar, the low for that bar matches the value of the Lowest Low (green) line.