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.

Kevin Gong

Real Camarilla Pivot Points in ToS

Recommended Posts

Kevin Gong

Hi,

I've been using thinkorswim for charts for my trading and I found it incredibly frustrating that the Camarilla Pivot Points in ToS is just wrong and weird.

So I fixed it. 

The issues with the original ToS Camarilla Pivot Points

  • Doesnt use After Market data - for closing value and High and Low
  • Doesnt show R1 and S1 natively 

Without these, well it's pretty useless.

So here is my script, I hope this helps everyone trade better on ToS.

To use this ThinkScript follow the directions

  1. Open up Studies in ToS chart
  2. Create a new Script (Click on the big "Create" button)
  3. Write in Title for Script, I suggest Kevin'sCamPivots
  4. Remove the default code, something to do with plot
  5. Copy and Paste my code in.
  6. Press 'Ok' button
  7. now add it to your chart

This script also allows you to manually overide the Close High and Low values in the settings. This is because the values may still differ from DAS and you can have the flexibility to manually change the values. 

#
# Kevin Gong - Camarilla Pivot Points 
# Email me for support - [email protected]
# Copy Right - Do not distribute this code without my consent.
#

input aggregationPeriod = {default "DAY", "WEEK", "MONTH"};
input length = 1;
input SetClose = 0.00;
input PreMaketHigh = 0.00;
input PreMaketLow = 0.00;

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 Today = GetDay() == GetLastDay();
def Yesterday = GetDay() == GetLastDay() - 1;
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 prevHigh = if YesterDay and !YesterDay[1]
               then high
               else if Yesterday and
                       high > prevHigh[1]
                    then high
               else prevHigh[1];
def prevLow = if Yesterday and !Yesterday[1]
              then low
              else if Yesterday and
                      low < prevLow[1]
                    then low
               else prevLow[1];

def camhighValue = if PreMaketHigh == 0 then prevHigh else PreMaketHigh;
def camlowValue = if PreMaketLow == 0 then prevLow else PreMaketLow;

def last = if Today and !Today[1]
           then close[1]
           else last[1];

def camClose = if SetClose == 0 then last else SetClose;
def range = camhighValue - camlowValue;

plot R5 = (camhighValue / camlowValue) * camClose;
plot R4 = camClose + range * (1.1) / 2;
plot R3 = camClose + range * (1.1) / 4;
plot R2 = camClose + range * (1.1) / 6;
plot R1 = camClose + range * (1.1) / 12;
plot S1 = camClose - range * (1.1) / 12;
plot S2 = camClose - range * (1.1) / 6;
plot S3 = camClose - range * (1.1) / 4;
plot S4 = camClose - range * (1.1) / 2;
plot S5 = (camClose - (R5 - camClose));

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);

  • Like 2

Share this post


Link to post
Share on other sites
NTrader2021

Thanks for this share @Kevin Gong!

If you are interested in ever using Cams without premarket data (for example, per Thor, when today's premarket range falls within yesterday's daily range), the script below is much better than the standard one in TOS. Just be sure to change aggregation period to "1". I've checked between TOS and DAS and the values mirror very closely the cams provided when using "without premarket data."

 

input aggregationPeriod = {default "DAY", "WEEK", "MONTH"};
input length = 25;
input hide_s1_r1 = yes;
input lines = {default dashes, points, triangles, horizontal, squares};
input showbubbles_description = yes;
input showpricebubble = yes;

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;

def PH = high(period = aggregationPeriod)[1];
def PL = low(period = aggregationPeriod)[1];
def PC = close(period = aggregationPeriod)[1];

plot HH;
plot PP;
plot LL;

HH = PH;
LL = PL;
PP = (PH + PL + PC) / 3;

HH.SetStyle(Curve.MEDIUM_DASH);
LL.SetStyle(Curve.MEDIUM_DASH);

plot R6 = (highValue / lowValue) * closeValue;
plot R4 = closeValue + range * (1.1) / 2;
plot R3 = closeValue + range * (1.1) / 4;
plot R5 = r4 + 1.168 * (R4 – R3);
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;
plot S5 = S4-1.168 * (s3 - s4);
plot S6 = (closeValue - (R6 - closeValue));

R1.SetHiding(hide_s1_r1);
S1.SetHiding(hide_s1_r1);

R6.SetDefaultColor(GetColor(6));
R5.SetDefaultColor(GetColor(6));
R4.SetDefaultColor(GetColor(6));
R3.SetDefaultColor(GetColor(6));
R2.SetDefaultColor(GetColor(6));
R1.SetDefaultColor(GetColor(6));
S1.SetDefaultColor(GetColor(5));
S2.SetDefaultColor(GetColor(5));
S3.SetDefaultColor(GetColor(5));
S4.SetDefaultColor(GetColor(5));
S5.SetDefaultColor(GetColor(5));
S6.SetDefaultColor(GetColor(5));

def paintingStrategy = if lines == lines.points then PaintingStrategy.POINTS else if lines == lines.triangles then PaintingStrategy.TRIANGLES else if lines == lines.dashes then PaintingStrategy.DASHES else if lines == lines.horizontal then PaintingStrategy.HORIZONTAL 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);

#Bubbles to describe Pivot Levels

input bubblemover = 8;
def n = bubblemover;
def n1 = n + 1;

def StartPlot = if showbubbles_description == yes then (IsNaN(close[n]) and !IsNaN(close[n1])) else Double.NaN;


AddChartBubble(StartPlot, R6[n1], "R6 " + (if showpricebubble then AsText(R6[n1]) else ""), Color.GREEN,   if close[n1] > R6[n1] then no else yes);
AddChartBubble(StartPlot, R5[n1], "R5 " + (if showpricebubble then AsText(R5[n1]) else ""), Color.GREEN,   if close[n1] > R5[n1] then no else yes);
AddChartBubble(StartPlot, R4[n1], "R4 " + (if showpricebubble then AsText(R4[n1]) else ""), Color.GREEN,   if close[n1] > R4[n1] then no else yes);
AddChartBubble(StartPlot, R3[n1], "R3 " + (if showpricebubble then AsText(R3[n1]) else ""), Color.GREEN,   if close[n1] > R3[n1] then no else yes);
AddChartBubble(StartPlot, R2[n1], "R2 " + (if showpricebubble then AsText(R2[n1]) else ""), Color.GREEN,   if close[n1] > R2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, R1[n1], "R1 " + (if showpricebubble then AsText(R1[n1]) else ""), Color.GREEN,   if close[n1] > R1[n1] then no else yes);

AddChartBubble(StartPlot, S6[n1], "S6 " + (if showpricebubble then AsText(S6[n1]) else ""), Color.RED, if close[n1] > S6[n1] then no else yes);
AddChartBubble(StartPlot, S5[n1], "S5 " + (if showpricebubble then AsText(S5[n1]) else ""), Color.RED, if close[n1] > S5[n1] then no else yes);
AddChartBubble(StartPlot, S4[n1], "S4 " + (if showpricebubble then AsText(S4[n1]) else ""), Color.RED, if close[n1] > S4[n1] then no else yes);
AddChartBubble(StartPlot, S3[n1], "S3 " + (if showpricebubble then AsText(S3[n1]) else ""), Color.RED, if close[n1] > S3[n1] then no else yes);
AddChartBubble(StartPlot, S2[n1], "S2 " + (if showpricebubble then AsText(S2[n1]) else ""), Color.RED, if close[n1] > S2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, S1[n1], "S1 " + (if showpricebubble then AsText(S1[n1]) else ""), Color.RED, if close[n1] > S1[n1] then no else yes);

R1.HideBubble();
R2.HideBubble();
R3.HideBubble();
R4.HideBubble();
R5.HideBubble();
R6.HideBubble();

S1.HideBubble();
S2.HideBubble();
S3.HideBubble();
S4.HideBubble();
S5.HideBubble();
S6.HideBubble();

  • Like 3

Share this post


Link to post
Share on other sites
Kevin Gong

Regarding your question on the other Thread about the closing value for ETFs being different in DAS and ToS.

Good catch, I did notice this myself and that is the reason I have the manual overide for the values as an option.

As for the reason for the difference, I'm not too sure. First, I'm not aware of the code that DAS uses for closing value and second I'm not entirely sure how ToS does it either. Though, I would guess that it would have something to do with how they display the price of the equity when the spread is larger at illiquid periods. 

I remember reading that after hour trading is actually somewhat different per broker. DAS is most commonly used with IBKR and ToS uses TDA. The way that After hour trading is conducted is not through exchanges like in NYSE exchange during trading hours but through Electronic Comms Networks. If the two brokers have a difference in the ECN, then one can expect a different prices of quotes after hours. This is just a wild theory....

The difference is probably exasperated for ETFs because they trade 24hrs.

 

  • Like 1

Share this post


Link to post
Share on other sites
NTrader2021

Thanks for the response. I think I may have discovered the issue (though I don't know how to change the code accordingly, but you might).

From my understanding (and I've checked this manually on the calculator), to calculate CAMs using premarket data, DAS takes the previous day's highs/lows that occurred anytime between 0400 and 2000. The value used to calculate the close is the closing price as of 1959. That's why aftermarket earnings and other news creates such disparities between standard TOS Cam levels and DAS. TOS uses 0930-1600.

That said, I think your script is calculating the closing value as of 2359. This is why the 24-hour ETFs (and not general stocks) were slightly different. If you could change the script to define the close as 1959, I think it would perfectly match DAS (assuming the cut-off for the highs/lows is also defined as occurring within 0400-2000).

Since prices change very little this late at night, you may not want to bother with the code change...but at least I think that is the answer to why the ETFs were slightly off.

Again, THANK YOU for sharing. It has been frustrating watching the price action stall at the DAS Cam values and being unable to see that on TOS.

Share this post


Link to post
Share on other sites
Kevin Gong

Hmmmm, I spent several hours looking into this, and I'm not going to lie, it's a real B to grab a value at a specific time on ThinkScript....... 

I'll try to ask ThinkorSwim community to do this for me. But for now, you can manually enter the closing price at 1959 into the study settings. Hopefully I get a response and I can update the code and post it here.

Thanks for getting that detail though. I would never have guessed that DAS grabs it's Settlement Price at 1959 for the day.

Share this post


Link to post
Share on other sites
Kevin Gong

Finding a lot of issues with my code 😞 

The problem lies with EFT vs Individual Tickers. The nature of the 24hr ETF means that the code doesn't like the same logic applied. For now I can say use this code, which is simply the Settlement Price of the ticker being adjusted to the AfterHours price, and the capability to manually change the close, high and low. I'll probably have to supply two different Scripts in the future for ETFs and Regular Tickers.

 

#
# Kevin Gong - Camarilla Pivot Points 
# Email me for support - [email protected]
# Copy Right - Do not distribute this code without my consent.
#
#
# TD Ameritrade IP Company, Inc. (c) 2013-2022
#

input aggregationPeriod = {default "DAY", "WEEK", "MONTH"};
input length = 1;
input SetClose = 0.00;
input SetHigh = 0.00;
input SetLow = 0.00;

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 Today = GetDay() == GetLastDay();

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 closeValue = if Today and !Today[1]
           then close[1]
           else closeValue[1];

def camhighValue = if SetHigh == 0 then highValue else SetHigh;
def camlowValue = if SetLow == 0 then lowValue else SetLow;
def camClose = if SetClose == 0 then closeValue else SetClose;

def range = camhighValue - camlowValue;

plot R5 = (highValue / lowValue) * closeValue;
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;
plot S5 = (closeValue - (R5 - closeValue));

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);

 

 

Share this post


Link to post
Share on other sites
NTrader2021

I definitely saw problems on Monday, however on Tuesday, the values lined up...so it may have something to do with "previous day" looking at Sunday, and not the previous trading day (Friday).

Also, I found the following bit of code that when inserted into yours, seems to grab the close at 2000:

def sessionopen=1945;
def sessionclose=1955;

So the following includes the modifications (I also added some labeling bubbles), and checking SPY on TOS to DAS, the levels line up perfectly on Tuesday: R4 = 412.89 (TOS) vs 412.885 (DAS) and S4 = 407.37 (TOS) vs 407.375 (DAS). NVDA, MSFT, and other stocks appeared to match as well.

The code didn't work on Monday, however, which again I think has something to do with the weekend and what day TOS was trying to grab data from. I'm only a "cut, copy, and paste coder," so I really can't decipher or solve the issue here unfortunately...just a hunch.

 

input aggregationPeriod = {default "DAY", "WEEK", "MONTH"};
input length = 1;
input SetClose = 0.00;
input PreMaketHigh = 0.00;
input PreMaketLow = 0.00;
input hide_s1_r1 = yes;
input hide_s2_r2 = yes;
input showbubbles_description = yes;
input showpricebubble = yes;

def sessionopen=1945;
def sessionclose=1955;

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 Today = GetDay() == GetLastDay();
def Yesterday = GetDay() == GetLastDay() - 1;
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 prevHigh = if YesterDay and !YesterDay[1]
               then high
               else if Yesterday and
                       high > prevHigh[1]
                    then high
               else prevHigh[1];
def prevLow = if Yesterday and !Yesterday[1]
              then low
              else if Yesterday and
                      low < prevLow[1]
                    then low
               else prevLow[1];

def camhighValue = if PreMaketHigh == 0 then prevHigh else PreMaketHigh;
def camlowValue = if PreMaketLow == 0 then prevLow else PreMaketLow;

def last = if Today and !Today[1]
           then close[1]
           else last[1];

def range = camhighValue - camlowValue;

input start = 1945;
input marketClose = 1955;
def closeCounter = SecondsTillTime(marketClose) >= 0 and SecondsFromTime(start) >= 0;
rec camClose = if closecounter and !isnan(close) then close else camClose[1];

plot R6 = (camhighValue / camlowValue) * camClose;
plot R4 = camClose + range * (1.1) / 2;
plot R3 = camClose + range * (1.1) / 4;
plot R2 = camClose + range * (1.1) / 6;
plot R1 = camClose + range * (1.1) / 12;
plot S1 = camClose - range * (1.1) / 12;
plot S2 = camClose - range * (1.1) / 6;
plot S3 = camClose - range * (1.1) / 4;
plot S4 = camClose - range * (1.1) / 2;
plot S6 = (camClose - (R6 - camClose));

R1.SetHiding(hide_s1_r1);
S1.SetHiding(hide_s1_r1);

R2.SetHiding(hide_s2_r2);
S2.SetHiding(hide_s2_r2);

R6.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));
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);
R4.SetPaintingStrategy(paintingStrategy);
R3.SetPaintingStrategy(paintingStrategy);
R2.SetPaintingStrategy(paintingStrategy);
R1.SetPaintingStrategy(paintingStrategy);
S1.SetPaintingStrategy(paintingStrategy);
S2.SetPaintingStrategy(paintingStrategy);
S3.SetPaintingStrategy(paintingStrategy);
S4.SetPaintingStrategy(paintingStrategy);
S6.SetPaintingStrategy(paintingStrategy);

#Bubbles to describe Pivot Levels

input bubblemover = -40;
def n = bubblemover;
def n1 = n + 1;

def StartPlot = if showbubbles_description == yes then (IsNaN(close[n]) and !IsNaN(close[n1])) else Double.NaN;

AddChartBubble(StartPlot, R6[n1], "R6 " + (if showpricebubble then AsText(R6[n1]) else ""), Color.RED,   if close[n1] > R6[n1] then no else yes);
AddChartBubble(StartPlot, R4[n1], "R4 " + (if showpricebubble then AsText(R4[n1]) else ""), Color.YELLOW,   if close[n1] > R4[n1] then no else yes);
AddChartBubble(StartPlot, R3[n1], "R3 " + (if showpricebubble then AsText(R3[n1]) else ""), Color.RED,   if close[n1] > R3[n1] then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, R2[n1], "R2 " + (if showpricebubble then AsText(R2[n1]) else ""), Color.GREEN,   if close[n1] > R2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, R1[n1], "R1 " + (if showpricebubble then AsText(R1[n1]) else ""), Color.GREEN,   if close[n1] > R1[n1] then no else yes);

AddChartBubble(StartPlot, S6[n1], "S6 " + (if showpricebubble then AsText(S6[n1]) else ""), Color.GREEN, if close[n1] > S6[n1] then no else yes);
AddChartBubble(StartPlot, S4[n1], "S4 " + (if showpricebubble then AsText(S4[n1]) else ""), Color.YELLOW, if close[n1] > S4[n1] then no else yes);
AddChartBubble(StartPlot, S3[n1], "S3 " + (if showpricebubble then AsText(S3[n1]) else ""), Color.GREEN, if close[n1] > S3[n1] then no else yes);
AddChartBubble(StartPlot and hide_s2_r2 == no, S2[n1], "S2 " + (if showpricebubble then AsText(S2[n1]) else ""), Color.RED, if close[n1] > S2[n1] then no else yes);
AddChartBubble(StartPlot and hide_s1_r1 == no, S1[n1], "S1 " + (if showpricebubble then AsText(S1[n1]) else ""), Color.RED, if close[n1] > S1[n1] then no else yes);

R1.HideBubble();
R2.HideBubble();
R3.HideBubble();
R4.HideBubble();
R6.HideBubble();

S1.HideBubble();
S2.HideBubble();
S3.HideBubble();
S4.HideBubble();
S6.HideBubble();

Edited by NTrader2021
  • Like 1

Share this post


Link to post
Share on other sites
Channer

Hey Miah, first thanks for creating the indicator.  Was excited to see Thor's cam set up for TOS but after adding it -seems like the w/ and w/o doesn't switch and I don't have bubbles on cams.  Could be me, any suggestions?

 

  • Like 2

Share this post


Link to post
Share on other sites
Channer

I think I figured out so again thanks so much for sharing your work!

  • 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.