Sadly no.
If you are asking, can you put lower timeframe plots on a higher timeframe chart? The answer is no.
The ToS platform only provides for higher aggregation to be placed on lower timeframe charts.
Ahh I missed that, can we do other way around? 10 min on 2 min chart?Sadly no.
If you are asking, can you put lower timeframe plots on a higher timeframe chart? The answer is no.
The ToS platform only provides for higher aggregation to be placed on lower timeframe charts.
Ahh I missed that, can we do other way around? 10 min on 2 min chart?
Only need Zigzag, we can remove the Fib stuff.
Is there anyway to place a bubble in the respective line above the current candle with the result of this calculation: (line - close) * 0.4 * 100 where line is the value of the swing low or swing high when these values are above the close? I'm trying to get it where I can see the dollar amount should price reaches those levels:This is meant to place a bubble at the last test of following swing low being below the previous swing low
# define swing low points
input length = 4;
def bn = BarNumber();
def lastBar = HighestAll(if IsNaN(close) then 0 else bn);
def offset = Min(length - 1, lastBar - bn);
def swingLow = low < Lowest(low[1], length - 1) and low == GetValue(Lowest(low, length), -offset);
# change candle colors just to make it easier to see what we are working with
AssignPriceColor(if swingLow then Color.LIME else Color.Current);
# identify the very last swing low point
def lowPointOneBarNumber = HighestAll(if swingLow then bn else 0);
def lowPointOneValue = if bn == lowPointOneBarNumber then low else lowPointOneValue[1];
plot low1 = if bn < lowPointOneBarNumber then Double.NaN else lowPointOneValue;
low1.SetPaintingStrategy(PaintingStrategy.DASHES);
low1.SetLineWeight(1);
low1.SetDefaultColor(Color.LIME);
# Store open, close, high, and low values of the swing low bar
def swingLowOpen = if bn == lowPointOneBarNumber then open else swingLowOpen[1];
def swingLowClose = if bn == lowPointOneBarNumber then close else swingLowClose[1];
def swingLowHigh = if bn == lowPointOneBarNumber then high else swingLowHigh[1];
# Plot the open, close, and high of the swing low bar
plot low1Open = if bn < lowPointOneBarNumber then Double.NaN else swingLowOpen;
plot low1Close = if bn < lowPointOneBarNumber then Double.NaN else swingLowClose;
plot low1High = if bn < lowPointOneBarNumber then Double.NaN else swingLowHigh;
# identify the 2nd to last swing low point
def lowPointTwoBarNumber = HighestAll(if swingLow and bn < lowPointOneBarNumber then bn else 0);
def lowPointTwoValue = if bn == lowPointTwoBarNumber then low else lowPointTwoValue[1];
plot low2 = if bn < lowPointTwoBarNumber then Double.NaN else lowPointTwoValue;
low2.SetPaintingStrategy(PaintingStrategy.DASHES);
low2.SetLineWeight(1);
low2.SetDefaultColor(Color.LIME);
# just keep doing ths for as many lines as you want to add to the chart
def lowPointThreeBarNumber = HighestAll(if swingLow and bn < lowPointTwoBarNumber then bn else 0);
def lowPointThreeValue = if bn == lowPointThreeBarNumber then low else lowPointThreeValue[1];
plot low3 = if bn < lowPointThreeBarNumber then Double.NaN else lowPointThreeValue;
low3.SetPaintingStrategy(PaintingStrategy.DASHES);
low3.SetLineWeight(1);
low3.SetDefaultColor(Color.LIME);
# just keep doing ths for as many lines as you want to add to the chart
def lowPointFourBarNumber = HighestAll(if swingLow and bn < lowPointThreeBarNumber then bn else 0);
def lowPointFourValue = if bn == lowPointFourBarNumber then low else lowPointFourValue[1];
plot low4 = if bn < lowPointFourBarNumber then Double.NaN else lowPointFourValue;
low4.SetPaintingStrategy(PaintingStrategy.DASHES);
low4.SetLineWeight(1);
low4.SetDefaultColor(Color.LIME);
def back = 99;#lastBar - lowPointThreeBarNumber + 1;
def x1 = fold i1 = 0 to back with t1 do GetValue(low1, -i1);
def x2 = fold i2 = 0 to back with t2 do GetValue(low2, -i2);
def x3 = fold i3 = 0 to back with t3 do GetValue(low3, -i3);
AddChartBubble(if x2 > x1 then bn == lowPointTwoBarNumber else Double.NaN, low2, low2, low2.TakeValueColor(), no);
AddChartBubble(if x2 < x1 and x3 > x2 then bn == lowPointThreeBarNumber else Double.NaN, low3, low3, low3.TakeValueColor(), no);
def swingHigh = high > Highest(high[1], length - 1) and high == GetValue(Highest(high, length), -offset);
# change candle colors just to make it easier to see what we are working with
AssignPriceColor(if swingLow then Color.LIME else if swingHigh then Color.PINK else Color.Current);
# identify the very last swing high point at the swing low bubble
def highPointOneBarNumber = if x2 > x1 then lowPointTwoBarNumber else if x2 < x1 and x3 > x2 then lowPointThreeBarNumber else Double.NaN;
# identify the swing high point before and after bubble swing low
def highPointTwoBarNumber = HighestAll(if swingHigh and bn < HighestAll(highPointOneBarNumber) then bn else 0);
def highPointTwoValue = if bn == highPointTwoBarNumber then high else highPointTwoValue[1];
def highbefore = if bn < highPointTwoBarNumber then Double.NaN else highPointTwoValue;
def highPointTwo_BarNumber = LowestAll(if swingHigh and bn > HighestAll(highPointOneBarNumber) then bn else Double.NaN);
def highPointTwo_Value = if bn == highPointTwo_BarNumber then high else highPointTwo_Value[1];
def highafter = if bn < highPointTwo_BarNumber then Double.NaN else highPointTwo_Value;
def lower_of_highs_barnumber = if highbefore < highafter then highPointTwoBarNumber else if highbefore > highafter then highPointTwo_BarNumber else Double.NaN;
plot high2 = if bn < HighestAll(lower_of_highs_barnumber) then Double.NaN else HighestAll(Min(highbefore, highafter));
high2.SetPaintingStrategy(PaintingStrategy.DASHES);
high2.SetLineWeight(1);
high2.SetDefaultColor(Color.PINK);
#
Is there anyway to place a bubble in the respective line above the current candle with the result of this calculation: (line - close) * 0.4 * 100 where line is the value of the swing low or swing high when these values are above the close? I'm trying to get it where I can see the dollar amount should price reaches those levels:
If his criteria, comparing x1, x2 and x3 are not met, there will not be any bubbles. His code was basically showing how to extend lines with the fold function.Code:################## input percent = .04; AddChartBubble(if x2 > x1 then bn == lastBar else Double.NaN, low2, asdollars((if close > low2 then (close - low2) else (low2 - close)) * percent * 100) + "\n" + asdollars(low2 + ((if close < low2 then (close - low2) else (low2 - close)) * percent * 100)), low2.TakeValueColor(), if close < low2 then yes else no); AddChartBubble(if x2 < x1 and x3>x2 then bn == lastBar else Double.NaN, low3, asdollars((if close < low3 then (close - low3) else (low3 - close)) * percent * 100) + "\n" + asdollars(low3 + ((if close < low3 then (close - low3) else (low3 - close)) * percent * 100)), low3.TakeValueColor(), if close < low3 then yes else no); AddChartBubble(bn == HighestAll(lower_of_highs_barnumber), high2, asdollars(high2), high2.TakeValueColor()); AddChartBubble(bn == lastBar, high2, asdollars((if close < high2 then (close - high2) else (high2 - close)) * percent * 100) + "\n" + asdollars(high2 + ((if close < high2 then (close - high2) else (high2 - close)) * percent * 100)), high2.TakeValueColor());
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.