# Workbook created

Hello, Mr Darren how are you?
Hope everything is fine!

I’m working on with some breakout scans.
Would you mind to share with me the workbook created
in this tweet below:
https://twitter.com/Optuma/status/1482727843171868672?t=JzBy3BTgpMf_3_i2Z3lAzw&s=19

Thank you,

Best
RF

Hi Rafi - here’s the code I used for the weekly pivot level breakout scan:

https://forum.optuma.com/topic/twitter-charts-2/#post-67357

It was linked to a watchlist (see video: https://www.optuma.com/videos/linking-a-watchlist-to-a-scan/) using this to calculate the % Avg 12 week volume column:

`VOL(Week(PERIODAMOUNT=1)) / MA(VOL(Week(PERIODAMOUNT=1)), BARS=12, CALC=Close)`

Thanks!

Mr Darren thank you very much for your reply!

Everything worked as expected, but i still need a little help here, please.
I´m strugling with somethig that i thought will be easy.

I´m building a watchlist (including scripts above), but also i´d like to show in columms three imediate resistences above the last price and three supports below.

For colum “R1” (first resistence) i used

```V1=PIVOT(MIN=6, TYPE=High);
V2=VALUEWHEN(HIGH(), V1);
V2```
```For columm "R2" (second resistence) i used:

V1=PIVOT(MIN=10, TYPE=High);
V2=VALUEWHEN(HIGH(), V1);
v2

As you can see from the image attached for "ABEV3 BS EQUITY" i think i got it right, but for "AZUL4 BS EQUITY" the values are
exact the same. How is that possible? I´m using diferent mumber on PIVOT MIN.

What am i missing?
Thank you again.

RAFI.

```

Thanks Rafi. A 6 bar pivot count could be at the same level as a 10 bar count, so you can’t really use that to get the levels.

Getting the previous 6 bar pivot level is quite tricky, but here’s the script - note that I would recommend ignoring unconfirmed pivots in scripting as the labels can change when new data is added to the chart (see the Pivot Label KnowledgeBase article for more information on unconfirmed pivots).

Previous resistance level:

```//Define the pivot setting;
Piv1 = PIVOT(MIN=6, TYPE=High, IGNOREUNCONFIRMED=True);
//Get the bar date of the signal before last - increase the OFFSET to go further back;
P1 = BARDATE();
P2 = LAST(BARDATE(NONZERO(Piv1), OFFSET=1));
Signal = P1 == P2;
//High value at the signal;
VALUEWHEN(HIGH(),Signal)```

Increase the OFFSET value in P2 to get the value of the previous pivot labels. The support levels use the same script but modified slightly to use the Low pivot type in Piv1, and to get the Low value. Save and open the attached workbook in your copy of Optuma.

Pivot-Levels.owb (39.3 KB)

Perfect! Thanks a lot!!

All the Best,
RAFI.