Join useThinkScript to post your question to a community of 21,000+ developers and traders.
# TS_TapeMomentum
# http://www.thinkscripter.com
# [email protected]
# Last Update 07 Nov 2010
#hint: For use on tick charts <b>ONLY</b>. Red inidcates average momentum, yellow > average, green > two standard deviations.
#hint period: Averaging period.
#hint capMultiplier: Multiple of standard deviation at which large spikes will be truncated with a magenta dot.
#hint capLargeSpikes: Truncate larger spikes at a given standard deviation multiplier to avoid scale compression.
declare lower;
input period = 14;
input capMultiplier = 5.0;
input capLargeSpikes = YES;
def isTickChart = if getAggregationPeriod() <= 3200 then 1 else 0;
def timer = secondsTillTime(1615);
def deltaT = absValue(timer[-1]-timer);
def momentum = if isTickChart then volume/deltaT else 0;;
def aveSM = average(momentum,period);
def sdAve = aveSM+2*stdev(momentum, period);
def spikeCap = totalSum(momentum)/barNumber()*capMultiplier;
plot tickMomentum = if capLargeSpikes then min(momentum, spikeCap) else momentum;
plot cap = if capLargeSpikes and tickMomentum==spikeCap then spikeCap else double.nan;
cap.setStyle(curve.POINTS);
cap.setLineWeight(2);
cap.setDefaultColor(color.magenta);
tickMomentum.setPaintingStrategy(paintingStrategy.HISTOGRAM);
tickMomentum.setLineWeight(2);
tickMomentum.assignValueColor(if tickMomentum >=min(spikeCap, sdAve) then color.green else if tickMomentum > aveSM then color.yellow else color.red);
plot zero = 0;
zero.setDefaultColor(color.white);
addChartLabel(!isTickChart,"THIS STUDY ONLY FOR USE ON TICK CHARTS",color.red);
def momentum = if isTickChart then volume/deltaT else 0;;
def momentum = volume/deltaT;
declare lower;
#########################################################
plot neutral_line_pos = 1;
neutral_line_pos.SetDefaultColor(Color.GRAY);
neutral_line_pos.SetStyle(Curve.SHORT_DASH);
plot zero_line = 0;
zero_line.SetDefaultColor(Color.GRAY);
#########################################################
def tdiff = SecondsFromTime(0930);
def tsrw = (1 / (tdiff[0] - tdiff[1])) * 100;
input period = 21;
def tsavg = average(tsrw[1], period);
def tsrtavg = tsrw / tsavg;
def truncate = if tsrtavg > 3 then 3 else tsrtavg; #required to attenuate HUGE signals that make the smaller signals hard to read
plot tape_speed = truncate;
tape_speed.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
tape_speed.AssignValueColor(if tape_speed >= 2 then COLOR.WHITE else if tape_speed > 1.0 then Color.GRAY else Color.DARK_GRAY);
declare lower;
#########################################################
plot neutral_line_pos = 1;
neutral_line_pos.SetDefaultColor(Color.GRAY);
neutral_line_pos.SetStyle(Curve.SHORT_DASH);
plot zero_line = 0;
zero_line.SetDefaultColor(Color.GRAY);
#########################################################
def tdiff = SecondsFromTime(0930);
def tsrw = (1 / (tdiff[0] - tdiff[1])) * 100;
input period = 21;
def tsavg = average(tsrw[1], period);
def tsrtavg = tsrw / tsavg;
def truncate = if tsrtavg > 3 then 3 else tsrtavg; #required to attenuate HUGE signals that make the smaller signals hard to read
plot tape_speed = truncate;
tape_speed.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
tape_speed.AssignValueColor(if tape_speed >= 2 then COLOR.WHITE else if tape_speed > 1.0 then Color.GRAY else Color.DARK_GRAY);
declare lower;
#########################################################
plot neutral_line_pos = 1;
neutral_line_pos.SetDefaultColor(Color.GRAY);
neutral_line_pos.SetStyle(Curve.SHORT_DASH);
plot zero_line = 0;
zero_line.SetDefaultColor(Color.GRAY);
#########################################################
def tdiff = SecondsFromTime(0930);
def tsrw = (1 / (tdiff[0] - tdiff[1])) * 100;
input period = 21;
def tsavg = average(tsrw[1], period);
def tsrtavg = tsrw / tsavg;
def truncate = if tsrtavg > 3 then 3 else tsrtavg; #required to attenuate HUGE signals that make the smaller signals hard to read
plot tape_speed = truncate;
tape_speed.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
tape_speed.AssignValueColor(if tape_speed >= 2 then COLOR.WHITE else if tape_speed > 1.0 then Color.GRAY else Color.DARK_GRAY);
declare lower;
#########################################################
plot neutral_line_pos = 1;
neutral_line_pos.SetDefaultColor(Color.GRAY);
neutral_line_pos.SetStyle(Curve.SHORT_DASH);
plot zero_line = 0;
zero_line.SetDefaultColor(Color.GRAY);
#########################################################
def tdiff = SecondsFromTime(0930);
def tsrw = (1 / (tdiff[0] - tdiff[1])) * 100;
input period = 21;
def tsavg = average(tsrw[1], period);
def tsrtavg = tsrw / tsavg;
def truncate = if tsrtavg > 3 then 3 else tsrtavg; #required to attenuate HUGE signals that make the smaller signals hard to read
plot tape_speed = truncate;
tape_speed.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
tape_speed.AssignValueColor(if tape_speed >= 2 then COLOR.WHITE else if tape_speed > 1.0 then Color.GRAY else Color.DARK_GRAY);
@givemethenews99 @Pelonsax You need to use it on TICK charts. It works perfectly.Hello
I added the study and got it to work.
No issues.
But - It's wonderful! But, I loaded it and am only getting a signal during AH. Any tips on a fix? (See below)-
Pelonsax
Active member above had the same issue.
Has anyone been able to fix this.
Also when I edit the study there is no input section to change any settings.
Is this script complete?
how many ticks do you usually trade with?@givemethenews99 @Pelonsax You need to use it on TICK charts. It works perfectly.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Repaints Cup and Handle Indicator for ThinkorSwim | Indicators | 23 | ||
The Ultimate Buy and Sell Indicator for ThinkOrSwim | Indicators | 5 | ||
Z-Score Probability Indicator for ThinkOrSwim | Indicators | 29 | ||
HTF PO3 Indicator For ThinkOrSwim | Indicators | 37 | ||
Market Bias (CEREBR) Indicator for ThinkOrSwim | Indicators | 13 |
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.