THINKORSWIM: MARCH 2013
- Details
- Parent Category: Departments
- Category: Traders' Tips
- Written by thinkorswim

In “Camarilla Points” in this issue, author Slawomir Bobrowski discusses the importance of using and understanding pivot points. The article focuses on using camarilla points as the basis for pivot points.
For thinkorswim users, we have created a study based on Bobrowski’s article in our proprietary scripting language, thinkScript. Once the study has been added, you can adjust the parameters of the study within the Edit Studies window to fine tune your new pivot points.
The study:
- From TOS charts, select “Studies” → “Edit studies”
- Select the “Studies” tab in the upper left-hand corner
- Select “New” in the lower left-hand corner
- Name the study (such as, “CamarillaPoints”)
-
Click in the script editor window, remove “plot data = close” and paste the following:
input aggregationPeriod = {default "DAY", "WEEK", "MONTH"}; input length = 25; input predictionLength = 0; Assert(length > 0, "'length' should be positive: " + length); Assert(predictionLength >= 0, "'prediction length' should be greater than or equal to 0: " + predictionLength); Assert(predictionLength <= length, "'prediction length' should be less than or equal to 'length'"); def isEnd = !IsNaN(close(period = aggregationPeriod)[-length + predictionLength]) and IsNaN(close(period = aggregationPeriod)[-length + predictionLength - 1]); def highValue = if isEnd then Highest(high(period = aggregationPeriod), length) else highValue[1]; def lowValue = if isEnd then Lowest(low(period = aggregationPeriod), length) else lowValue[1]; def closeValue = if isEnd then close(period = aggregationPeriod) else closeValue[1]; def show = !IsNaN(close(period = aggregationPeriod)[predictionLength]) and IsNaN(close(period = aggregationPeriod)[-length + predictionLength]); def range = highValue - lowValue; plot R5; plot R4; plot R3; plot R2; plot R1; plot S1; plot S2; plot S3; plot S4; plot S5; if !show then { R5 = Double.NaN; R4 = Double.NaN; R3 = Double.NaN; R2 = Double.NaN; R1 = Double.NaN; S1 = Double.NaN; S2 = Double.NaN; S3 = Double.NaN; S4 = Double.NaN; S5 = Double.NaN; } else { R5 = (highValue / lowValue) * closeValue; R4 = closeValue + range * (1.1) / 2; R3 = closeValue + range * (1.1) / 4; R2 = closeValue + range * (1.1) / 6; R1 = closeValue + range * (1.1) / 12; S1 = closeValue - range * (1.1) / 12; S2 = closeValue - range * (1.1) / 6; S3 = closeValue - range * (1.1) / 4; S4 = closeValue - range * (1.1) / 2; S5 = (closeValue - (R5 - closeValue)); } R1.Hide(); S1.Hide(); R5.SetDefaultColor(GetColor(5)); R4.SetDefaultColor(GetColor(5)); R3.SetDefaultColor(GetColor(5)); R2.SetDefaultColor(GetColor(5)); R1.SetDefaultColor(GetColor(5)); S1.SetDefaultColor(GetColor(6)); S2.SetDefaultColor(GetColor(6)); S3.SetDefaultColor(GetColor(6)); S4.SetDefaultColor(GetColor(6)); S5.SetDefaultColor(GetColor(6)); def paintingStrategy = if aggregationPeriod == aggregationPeriod.DAY then PaintingStrategy.POINTS else if aggregationPeriod == aggregationPeriod.WEEK then PaintingStrategy.TRIANGLES else PaintingStrategy.SQUARES; R5.SetPaintingStrategy(paintingStrategy); R4.SetPaintingStrategy(paintingStrategy); R3.SetPaintingStrategy(paintingStrategy); R2.SetPaintingStrategy(paintingStrategy); R1.SetPaintingStrategy(paintingStrategy); S1.SetPaintingStrategy(paintingStrategy); S2.SetPaintingStrategy(paintingStrategy); S3.SetPaintingStrategy(paintingStrategy); S4.SetPaintingStrategy(paintingStrategy); S5.SetPaintingStrategy(paintingStrategy);
A sample thinkorswim chart is shown in Figure 3.

FIGURE 3: THINKORSWIM. Here, camarilla points are used as the basis for pivot points.


Join us on Facebook
Follow us on Twitter