Jump to content

We have moved to Discord. Please click here to join us in the Trading Terminal Discord server.



These forums are read-only.

KyleK29

Tool: Pivot Point Helper for S5, S6, R5, R6 values ...

Recommended Posts

KyleK29

Quickly put together a helper page last Wednesday (?) to calculate the extended Pivot Points. Takes in a symbol, gives you the values for S5, S6, R5, and R6. 

  1. Note: This is for those that use the DAS Study -> Pivot Points w/ Camarilla and Post/Premarket data included.
    > Special Note: Daily charts in DAS exclude the Pre/Post market data, so the data will not align (thanks to RP for pointing this out), please use an intraday chart when comparing values.

    PivotPoints01.png
     
  2. Create a hotkey in DAS with the following script:
https://kaelmedia.com/projects/tradepivots/?symbol=%SYMB%

 

To use, just select a montage and hit the hotkey you just created. It'll launch a browser window which tells you the levels for S5, S6 and R5, R6. You'll need to mark these manually on the chart. The API I use for the data may not have all stocks, so just be aware if you don't get a value to first check that it got the proper symbol. It should say the symbol on the page, if not, try it again.

 

BONUS Tip!:

For those that experienced the PivotPoint wackiness over the holiday, you can fix this by right-clicking the chart -> Data Config -> Set to 5 Days minute chart (get 5 days worth of minute data is what this means). It'll then have the data necessary to calculate correctly. The default value does not have enough data to span the holiday.

PivotPoints_data01.png

 

Also, may I suggest that Peter's next Thor theme song be a cover of "Amarillo by Morning" as "Camarilla by Morning".

Edited by KyleK29
Cleaning up.
  • Like 9
  • Thanks 2

---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites
Mitch The Duck

Cheers Kyle, love your work mate. 
 

MiTCh 

Edited by Mitch The Duck

Share this post


Link to post
Share on other sites
Bryan W
On 12/6/2020 at 2:17 AM, Mitch The Duck said:

Cheers Kyle, love your work mate. 
 

MiTCh 

He sees needs and takes on the challenge! 

Share this post


Link to post
Share on other sites
Mark_888

Hi Kyle,

I'm on the latest version of DAS and the Camarilla Pivot Point Line does not show, I setup the color of the line to have contrast with the background but it doesn't appear at all.  The other pivot lines show.  (EDIT:  I just tried changing the pivot point type in DAS from Camarilla to the standard type, and the central Pivot Point Line show for those, but not Camarilla pivot points.)  I'm not sure if this is the right thread to ask about that problem, but it would be super helpful if the Pivot Point Line value is included in this helper utility!  I'm currently calculating it myself for each stock on my watch list and manually adding it.

Thanks

 

Edited by Mark_888

Share this post


Link to post
Share on other sites
Bryan W
3 hours ago, Mark_888 said:

Hi Kyle,

I'm on the latest version of DAS and the Camarilla Pivot Point Line does not show, I setup the color of the line to have contrast with the background but it doesn't appear at all.  The other pivot lines show.  (EDIT:  I just tried changing the pivot point type in DAS from Camarilla to the standard type, and the central Pivot Point Line show for those, but not Camarilla pivot points.)  I'm not sure if this is the right thread to ask about that problem, but it would be super helpful if the Pivot Point Line value is included in this helper utility!  I'm currently calculating it myself for each stock on my watch list and manually adding it.

Thanks

 

Maybe give it a couple more days based on your chart data... With market holidays, it can throw things off. 

 

Share this post


Link to post
Share on other sites
Mark_888
33 minutes ago, Bryan Walquist said:

Maybe give it a couple more days based on your chart data... With market holidays, it can throw things off. 

 

Thanks I've seen that video.  I had them added to the chart last weekend, the central point line didn't show during this week's trading, the other lines were there.

Share this post


Link to post
Share on other sites
Mark_888

Yesterday, on Monday, the helper is pulling from the wrong calendar day again.   The previous post, Jan 4th was a Monday and it was trying to pull data from Jan 3rd instead of Dec 31st, and my chart was configured correctly to pull more data being configured for a "5 Days minute chart".

So yesterday, Monday Jan 11th, the helper utility didn't work on a Monday again.  It was trying to pull data from the same day Jan 11th instead of Fri Jan 8th.  Here is a screenshot taken Monday Jan 11th to illustrate the problem, the utility shows what date it is trying to pull data from and it is the wrong date.  The utility doesn't appear to be taking weekends or weekends+holidays into consideration when pulling data, again my chart is configured correctly to pull more data being configured for a "5 Days minute chart":

1341401878_pivothelpererror.thumb.JPG.13e3cef5e33f860803b067f6e3aec933.JPG

 

Edited by Mark_888

Share this post


Link to post
Share on other sites
Greigh Hound

Can anyone show me how to avoid the pivot points squishing my candle bars?

  • Like 1

Share this post


Link to post
Share on other sites
Bryan W
1 minute ago, GreyTrader said:

Can anyone show me how to avoid the pivot points squishing my candle bars?

Right click in chart, study config, select pivot points, configex, uncheck include in scale. 

 

Share this post


Link to post
Share on other sites
Greigh Hound
1 hour ago, Bryan Walquist said:

Right click in chart, study config, select pivot points, configex, uncheck include in scale. 

 

 

Thank you

Share this post


Link to post
Share on other sites
KyleK29

 

On 1/12/2021 at 4:51 AM, Mark_888 said:

Yesterday, on Monday, the helper is pulling from the wrong calendar day again.   The previous post, Jan 4th was a Monday and it was trying to pull data from Jan 3rd instead of Dec 31st, and my chart was configured correctly to pull more data being configured for a "5 Days minute chart".

So yesterday, Monday Jan 11th, the helper utility didn't work on a Monday again.  It was trying to pull data from the same day Jan 11th instead of Fri Jan 8th.  Here is a screenshot taken Monday Jan 11th to illustrate the problem, the utility shows what date it is trying to pull data from and it is the wrong date.  The utility doesn't appear to be taking weekends or weekends+holidays into consideration when pulling data, again my chart is configured correctly to pull more data being configured for a "5 Days minute chart":

1341401878_pivothelpererror.thumb.JPG.13e3cef5e33f860803b067f6e3aec933.JPG

 

 

Because it was a prototype (not sure if anyone would actually use it), I didn't give much thought to this scenario. I just changed some things and we'll see how it works now. *knock on wood* It should adjust automatically for holidays / weekend scenarios.


---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites
Paul aka Aurbano

For those interested in a deeper analysis of the classic pivots vs the camarilla pivots, here is an small document with graphic examples on the representation of both .... Download the .TXT file and change the extension to .XLSX

Includes: formulas with calculations and AMD charts as example

 

20210301-133839.thumb.jpg.0486451d08941dfc4bfaff84837b6b1f.jpg

 

20210301-133858.thumb.jpg.631ead7718b6dd6e3156bc15bf0663b3.jpg

 

20210301-133909.thumb.jpg.f463bd531b5ea97d53d33f2642eebcd5.jpg

 

 

Pivots.txt

  • Thanks 2

Share this post


Link to post
Share on other sites
Marcus Leong

Thanks KyleK29 had been using your pivot calculation script for a while. Finally DAS included them. probably using your script too. lol 

DAS new release 2021 June version: 5.6.4.12.

Enhancements

Charting

-Added option to merge all partial fill trade triangles.
-Added S5, S6, R5, R6 for Camarilla pivot points.
-Added new style config window for Data Config dialog.
-Added new style config window for Study Config dialog.
-Added new style config window for Chart History dialog.
-Added new style config window for DataManage(DataBuffer) dialog.

Share this post


Link to post
Share on other sites
dunit

Hey - if anyone uses ToS, I adjusted to default to reflect Thor's calculations for R5, R6, S5, S6. The ToS default includes a different calculation for R5 and S5 and doesn't include R6 and S6 at all. Keep in mind, you'll still need to adjust the colors and save as default.

The numbers seem accurate - please verify before using. Let me know if this helps.

Here is the ThinkScript:

*****

 

input aggregationPeriod = {default "DAY", "WEEK", "MONTH"};
input length = 25;

Assert(length > 0, "'length' should be positive: " + length);

def yyyymmdd = GetYYYYMMDD();
def month = GetYear() * 12 + GetMonth();
def day_number = DaysFromDate(First(yyyymmdd)) + GetDayOfWeek(First(yyyymmdd));
def period;
switch (aggregationPeriod) {
case DAY:
    period = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
    period = Floor(day_number / 7);
case MONTH:
    period = Floor(month - First(month));
}
def count = CompoundValue(1, if period != period[1] then (count[1] + period - period[1]) % length else count[1], 0);
def start =  CompoundValue(1, count < count[1] + period - period[1], yes);
def highValue = if start then Highest(high(period = aggregationPeriod), length)[1] else if highValue[1] != 0 then highValue[1] else Double.NaN;
def lowValue = if start then Lowest(low(period = aggregationPeriod), length)[1] else if lowValue[1] != 0 then lowValue[1] else Double.NaN;
def closeValue = if start then close(period = aggregationPeriod)[1] else closeValue[1];
def range = highValue - lowValue;

#R6 added to default according to Thor's settings
plot R6 = (highValue / lowValue) * closeValue;
#R5 adjusted from ToS default according to Thor's settings
plot R5 = closeValue + range * (1.1) / 2 + 1.168 * ((closeValue + range * (1.1) / 2) - (closeValue + range * (1.1) / 4));
plot R4 = closeValue + range * (1.1) / 2;
plot R3 = closeValue + range * (1.1) / 4;
plot R2 = closeValue + range * (1.1) / 6;
plot R1 = closeValue + range * (1.1) / 12;
plot S1 = closeValue - range * (1.1) / 12;
plot S2 = closeValue - range * (1.1) / 6;
plot S3 = closeValue - range * (1.1) / 4;
plot S4 = closeValue - range * (1.1) / 2;
#S5 Adjusted from ToS default According Thor's Settings
plot S5 = closeValue - range * (1.1) / 2 - 1.168 * ((closeValue - range * (1.1) / 4) - (closeValue - range * (1.1) / 2));
#S6 Added According to Thor's Settings
plot S6 = closeValue - ((highValue / lowValue) * closeValue - closeValue);

R1.Hide();
S1.Hide();

R6.SetDefaultColor(GetColor(5));
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));
S6.SetDefaultColor(GetColor(6));

def paintingStrategy = if aggregationPeriod == aggregationPeriod.DAY then PaintingStrategy.POINTS else if aggregationPeriod == aggregationPeriod.WEEK then PaintingStrategy.TRIANGLES else PaintingStrategy.SQUARES;

R6.SetPaintingStrategy(paintingStrategy);
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);
S6.SetPaintingStrategy(paintingStrategy);

  • Like 1

Share this post


Link to post
Share on other sites

[[Template core/front/global/mobileNavigation is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.