#### Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

# Program Question -

IS THERE ANYWAY I CAN PROGRAM THIS INDICATOR INTO STOCKCHARTS
Is this a language SC uses?? Does STOCKCHARTS have a Script Editor, can You suggest one?
Thanks Bill PS Sorry if this a dumb question.

input BollingerDeviations = 2.0; input BollingerLength = 20.0; input KeltnerFactor = 1.5; input KeltnerLength = 20; input price = close; def bk = reference BollingerBandsSMA(" num_dev_up" = BollingerDeviations, "length" = BollingerLength )." upperband" - reference KeltnerChannels(" factor" = KeltnerFactor, "length" = KeltnerLength)." Upper_Band"; def grnconsecdots = if bk[ 0] > 0 and bk[ 1] > 0 and bk[ 2] > 0 and bk[ 3] > 0 and bk[ 4] > 0 and bk[ 5] > 0 andbk[ 6] > 0 then 7 else if bk[ 0] > 0 and bk[ 1] > 0 and bk[ 2] > 0 and bk[ 3] > 0 and bk[ 4] > 0 and bk[ 5] > 0 then 6 else if bk[ 0] > 0 and bk[ 1] > 0 and bk[ 2] > 0 and bk[ 3] > 0 and bk[ 4] > 0 then 5 else if bk[ 0] > 0 and bk[ 1] > 0 and bk[ 2] > 0 and bk[ 3] > 0 then 4 else if bk[ 0] > 0 and bk[ 1] > 0 and bk[ 2] > 0 then 3 else if bk[ 0] > 0 and bk[ 1] > 0 then 2 else if bk[ 0] > 0 then 1 else 0; def redconsecdots = if bk[ 0] < 0 and bk[ 1] < 0 and bk[ 2] < 0 then 3 else if bk[ 0] < 0 and bk[ 1] < 0 then 2 else if bk[ 0] < 0 then 1 else 0; plot signal = if grnconsecdots > 0 then grnconsecdots else redconsecdots + 10; signal.assignValueColor (color.BLACK); assignBackgroundColor( if bk[ 0] <

• mod
Hi Bill,

@gord can probably explain this better, but the scan engine is designed to work with built-in Stockcharts indicators and overlays and a few essential operators and functions to retrieve symbols from the SC database that fit the combination of values the user describes. It is meant to be simple enough for non-programmers to learn, yet flexible enough to write very sophisticated queries. I think it achieves those goals spectacularly well.

However, it is not, and is not meant to be, a full fledged language- it does not support user defined variables, if - else statements, loops, arrays or user defined functions, some of which the code above uses.

On the other hand, if you can describe in English what you are looking for from your code sample, it's quite possible that a scan using available SC indicators could be written. SC has both Bollinger Bands and Keltner channels.
• Markd:
re: Bollinger Band \ Keltner Channel SQUEEZE

The first step is to identify the stocks that are in a squeeze within your selected time frame which for us is 15-minutes.
We sort the list on that column so that the red boxes are on top of the list. These are the candidates deserving a closer inspection and we will visually inspect the charts for possible trade set ups. The stocks that are in a squeeze in a higher time frame as well merit special attention, since they could develop longer lasting trends once they come out of the volatility squeeze.

Keltner CH 20,1.5,20 B Bands 20,2,0 EMA 13,21,55

If you do not have XXX or access to this indicator on another platform you can set up the Bollinger Band, the Keltner Channel and a momentum indicator as described here [ i.e., !ADLINESPX and \$Tick (+-400, +-800) ]
Note: Momentum Indicators are separate charts.

Q. Would like to know if !ADLINESPX and \$Tick can be daily real time indicators in SC?
Q Is there Scan in StockCharts that can be substituted for Volitality Squeeze Scan??
Thanks Bill 10-24-15
• mod
edited October 2015
Q1. Both !ADLINESPX and \$TICK are available in real time on SC charts for NYSE/NASDAQ/TSX data at the ExtraRT and Pro level subscription levels. The Extra level gives BATS only real time.

Q2. However, you cannot scan for time frames below daily. So intraday scans are not available. You can run scans during the day using daily parameters but the most recent update is treated as closing data.

It is possible to construct a scan that looks for the B Bands inside the Kelt Chans using custom parameters in the daily time frame and above. The results can also be ranked for custom values, but I don't know what the "red boxes" represent, so I don't know if that can be done.

Also, note that an SC scan only searches a database to return qualified symbols. It does not control or alter the appearance of a chart. Although SC offers real time data, and you could use the intraday charts to trade, the site really excels as a resource for position traders (days, weeks, months) who rely on TA to select and manage trades in those timeframes.
• Thanks for the info, I have ExtraRT level and see what I can come up using intraday on a few stocks.
Thank you, Bill