Accessing Date data from Swinglist?

Hi,

I’m hoping to expose and use the date values of the start and end of volatility swings. I’ve searched but it seems that almost everyone is using the price value of the swing.

I’m interested in the date values (to feed into a pseudo time-extension style indicator).

Is there anyway of accessing this?

Hi Brendon,

To get the date of the current swing end try this:

V1 = VOLATILITYSWINGS();
V2 = SWINGEND(V1);
BARDATE(V2)

To get the dates of the previous swings use the OFFSET function, so for the swing before:

V1 = VOLATILITYSWINGS();
V2 = SWINGEND(V1);
BARDATE(V2, OFFSET=1)

To get the number of days between swings:

V1 = VOLATILITYSWINGS();
V2 = SWINGEND(V1);
BARDATE(V2) - BARDATE(V2, OFFSET=1)

If you want to show the dates in a watchlist column change the Column Type to Date:

Capture

Awesome, thank you.
I was playing with bardate but seems I wasn’t feeding it right.
Will try this today.

That works a treat,
However this :
BARDATE(V2) - BARDATE(V2, OFFSET=1)
gives me calendar days. Is there anyway to get the number of bars between the 2 signals?
I’ve played around with TimeSinceSignal and Acc, and tried including adding additional variables like close()>-0 to try to use the bar list not the swing list, but no luck.
Any advice?

Thanks again,
Brendon

Ah I just remembered a function called SWINGSTAT() which captures a lot of info, including the length in trading days. Current swing length in bars (trading days on a daily chart):

V1 = VOLATILITYSWINGS();
SWINGSTAT(V1, DEFAULT=Bars, SWINGS=1)

Previous swing length, using [1] for the offset:

V1 = VOLATILITYSWINGS();
SWINGSTAT(V1, DEFAULT=Bars, SWINGS=1)[1]

Average length of last 4 swings:

V1 = VOLATILITYSWINGS();
SWINGSTAT(V1, DEFAULT=AvgBars, SWINGS=4, TYPE=All)

Capture