0% found this document useful (0 votes)
180 views16 pages

V30 C02 249tips

Uploaded by

René
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views16 pages

V30 C02 249tips

Uploaded by

René
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Specialized

trading help.
On call.
In platform.
Or email.
Or social.
Connect with our award-winning customer service team, many with decades of prior floor trading
experience. Get trading help when you need it. Talk to a TD Ameritrade agent on the phone, chat
on our platforms, or contact us on social media.

Scan QR code or call 800-672-2098 to learn more.

Rated #1 in Customer Service 2022


by StockBrokers.com

Reviewed against 14 other online brokers, TD Ameritrade was highlighted as #1 in Customer Service in the StockBrokers.com 2022 Online Broker Review.
All investing involves risks, including loss of principal. TD Ameritrade, Inc., member FINRA/SIPC, a subsidiary of The Charles Schwab Corporation.
© 2022 Charles Schwab & Co., Inc. All rights reserved.
37 Years in the Making

metastock.com/whats-new

This is neither a solicitation to buy or sell any type of financial instruments, nor intended as investment recommendations. All investment trading involves multiple substantial risks
of monetary loss. Don’t trade with money you can’t afford to lose. Trading is not suitable for everyone. Past performance, whether indicated by actual or hypothetical results or
testimonials are no guarantee of future performance or success. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES
SIMILAR TO THOSE SHOWN. IN FACT, THERE ARE FREQUENTLY SHARP DIFFERENCES BETWEEN HYPOTHETICAL PERFORMANCE RESULTS OR TESTIMONIALS AND THE
ACTUAL RESULTS SUBSEQUENTLY ACHIEVED BY ANY PARTICULAR TRADING PROGRAM. Furthermore, all internal and external computer and software systems are not fail-
safe. Have contingency plans in place for such occasions. MetaStock assumes no responsibility for errors, inaccuracies, or omissions in these materials, nor shall it be liable for any
special, indirect, incidental, or consequential damages, including without limitation losses, lost revenue, or lost profits, that may result from reliance upon the information presented.
Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

For this month’s Traders’ Tips, the focus is


Barbara Star’s article in this issue, “Trade
Breakouts And Retracements With TMV.”
Code for Star’s template of indicators in
MetaStock is already provided in Star’s arti-
cle. Subscribers will also find the same code
at the Subscriber Area of our website, www.
Traders.com. Presented here is an overview
of possible implementations for other software.
Traders’ Tips are provided to help the reader imple-
ment a selected technique from an article in this issue.
The entries are contributed by various software develop-
ers or programmers for software that is capable of cus-
tomization.
Readers will find all the code listings that accompany
the following Traders’ Tips at our website, www.Traders.com.
Provided here is some discussion of the technique’s im-
plementation by the Traders’ Tips contributors as well as
some example charts.
To locate Traders’ Tips at our website, use our site’s
search engine, or click on the Traders’ Tips link from our
home page. For past Traders’ Tips, click on the “Archive”
button in the S&C Magazine box in the middle of our Figure 1: TRADESTATION, TMV INDICATORS. A daily chart of NAV is shown here
home page, then click on a Traders’ Tips topic of interest, along with the TMV indicators based on Barbara Star’s article in this issue. The red
or click on a different year to see more choices. and cyan bars show the ADX and eight-bar SMA/close relationship described in Star’s
article, and the yellow dot markers show Star’s volume surge criteria.

beled “Traders’ Tips, TASC.” Then select the appropriate link


F TRADESTATION: trend, momentum, volatility, and for the month and year. The ELD filename is “_TMV.ELD.”
volume (TMV) A sample chart is shown in Figure 1.
In “Trade Breakouts And Retracements With TMV” in this This article is for informational purposes. No type of trading
issue, author Barbara Star describes the use of several common or investment recommendation, advice, or strategy is being made,
indicators to analyze market trend, momentum, volatility, and given, or in any manner provided by TradeStation Securities or its
volume (TMV). These indicators include Keltner channels, affiliates.
—Chris Imhof
the commodity channel index (CCI), the average directional
TradeStation Securities, Inc.
movement index (ADX), and a volume oscillator. A subsidiary of TradeStation Group, Inc.
EasyLanguage code for a combined indicator (all but CCI) www.TradeStation.com
is presented here. The indicator code plots the Keltner chan-
nel and colors the bars based on the ADX and the relation-
ship of the bar’s closing price to an eight-bar simple moving
average. It also plots a dot marker based on volume surges.
F MetaStock: trend, momentum, volatility, and
Details of the conditions required for painting the bars and
volume (TMV)
plotting the dot markers can be found in Star’s article.
Code for the TMV indicator template is already provided in
The CCI can be plotted using the TradeStation built-in indi-
Barbara Star’s article elsewhere in this issue.
cator called Comm Channel Index. Also shown here is some
strategy code for a breakout strategy that enters long when
CCI is greater than zero and the close is greater than the upper
Keltner band; it enters short when CCI is less than zero and
the close is less than the lower Keltner band. A long position is F BLOOMBERG: trend, momentum, volatility, and
exited when price closes below the upper Keltner band or CCI volume (TMV)
goes below zero. A short position is exited when price closes In this issue, author Barbara Star introduces a method of using
above the lower Keltner band or CCI goes above zero. multiple types of indicators together to gain a better overall
To download the EasyLanguage code for the indica- picture of the market’s action. We have included a chart of
tor and strategy, first navigate to the EasyLanguage FAQs NYMEX RBOB in a bull market from summer 2010 through
and Reference Posts Topic in the EasyLanguage Support spring 2011 (see Figure 2). This was a major bull run in that
Forum (https://www.tradestation.com/Discussions/Topic. market, and the indicators in Star’s TMV trading template
aspx?Topic_ID=47452), scroll down, and click on the link la- help confirm the strength of this trend.
Copyright © Technical Analysis Inc.
Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

Figure 2: BLOOMBERG, paint bars, keltner bands, and cci. Here is a Figure 3: THINKORSWIM, TMV indicators. By using a combination of chan-
daily bar chart showing RBOB unleaded gas from July 2010 through May 2011. The nels, variable bar colors, and point indicators, the TMV study provides a large
chart includes paint bars determined by ADX and an eight-period simple moving amount of information in a compact space.
average, as well as Keltner bands around a 20-period simple moving average. The
panel below the price chart combines a CCI output as a histogram, with overlaid
rectangles based on the value of the volume oscillator included in the study code, study combines aspects of trend, momentum, volatility, and
but not actually output as part of the study. volume using several well-known and well-loved studies to
give insight into a securities movement without unnecessary
In Figure 2, you can see that many of the green bars on the clutter (no paralysis by analysis!). By using a combination of
chart coinciding with bullish signals for each breakout above channels, variable bar colors, and point indicators, the TMV
the channel are also accompanied by overlaid rectangles sig- study gives a large amount of information while saving valu-
naling that the volume oscillator component of the TMV is able charting real estate (Figure 3).
above its threshold setting, in this case a value of 50. Dur- The code for each study is shown here along with instruc-
ing this period, the CCI rarely went below zero, continually tions for application.
reaching extreme highs over 200. You can see that the first
time a major low in the CCI was realized in May 2011 — co- 1. From our TOS charts, select Studies → Edit studies.
inciding with the red bars below the lower channel band — 2. Select the studies tab in the upper left-hand corner.
began the change in the market to a consolidation mode. 3. Select New in the lower left-hand corner.
Using the CS.NET framework within the STDY<GO> 4. Name the study (for example, “TMV”).
function on the Bloomberg Terminal, C# or Visual Basic 5. Click in the script editor window, remove “plot Data =
code can be written to display the TMV trading template close;” and paste in the following code:
based on Star’s article. In addition to including all parts of
the template in one indicator, we have chosen to overlay the input price = close;
input KeltnerLength = 13;
rectangles on the CCI, since it allows the user to look in one input VolumeFastLength = 1;
place to see two of the components of the TMV. The C# code input VolumeSlowLength = 20;
input ADXLength = 10;
for this indicator is shown at Traders.com. input SMALength = 8;
All Bloomberg code contributions to Traders’ Tips can
also be found in the sample files provided with regular SDK def KeltnerSMA = Average(hlc3, KeltnerLength);
def AvgRange = Average(high - low, KeltnerLength);
updates, and the studies will be included in the Bloomberg def VolumeOsc = (Average(volume, VolumeFastLength) -
global study list. Average(volume, VolumeSlowLength)) / Average(volume,
—Bill Sindel, wsindel@bloomberg.net VolumeSlowLength);
Bloomberg, LP def ADX = reference ADX(length = ADXLength);
www.bloomberg.com/professional def SMA = Average(price, SMALength);

plot KeltnerHigh = KeltnerSMA + AvgRange;


plot KeltnerMid = KeltnerSMA;
plot KeltnerLow = KeltnerSMA - AvgRange;
plot VolumeSpike = VolumeOsc > 0.5;

KeltnerHigh.SetDefaultColor(GetColor(4));
F Thinkorswim.com: trend, momentum, volatility, KeltnerMid.SetDefaultColor(GetColor(4));
and volume (TMV) KeltnerLow.SetDefaultColor(GetColor(4));
VolumeSpike.SetDefaultColor(GetColor(1));
This month’s Traders’ Tip showcases the TMV indicator VolumeSpike.SetLineWeight(3);
described by Barbara Star in her article in this issue, “Trade VolumeSpike.SetPaintingStrategy(PaintingStrategy.BOOLEAN_
Breakouts And Retracements With TMV.” This compact POINTS);

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

Figure 5: TC2000, TMV. A scan of the S&P 500 using the TMV upside scan
returned 81 stocks. Sort columns in the watchlist show where price is above (green
Figure 4: eSIGNAL, TMV INDICATORS checks) and below (red checks) its eight-period SMA. A column for “percent volume
oscillator > 50” marks stocks (in cyan) with unusually high volume, such as URBN
and VMC in this example.
DefineGlobalColor("Up", Color.UPTICK);
DefineGlobalColor("Neutral", Color.GRAY);
DefineGlobalColor("Down", Color.DOWNTICK);
AssignPriceColor( if ADX > ADX[1] and price > SMA then A sample chart is shown in Figure 4.
globalColor("Up") else if ADX > ADX[1] and price < SMA then —Jason Keck
globalColor("Down") else globalColor("Neutral"));
eSignal, an Interactive Data company
800 779-6555, www.eSignal.com
6. Click OK, and you are good to go!
—thinkorswim
A division of TD Ameritrade, Inc.
www.thinkorswim.com

F WORDEN BROTHERS TC2000: trend, momentum,


volatility, and volume (TMV)
F eSIGNAL: trend, momentum, volatility, and You can combine the charting, scanning, and sorting features
volume (TMV) found in TC2000 version 12 to apply the TMV method dis-
For this month’s Traders’ Tip, we’ve provided two formulas, cussed in Barbara Star’s article in this issue, “Trade Breakouts
ADX_MA_Price_Relation.efs and Volume_Peaks.efs, based and Retracements with TMV.”
on the formula code from Barbara Star’s article in this issue, Figure 5 shows the results of a scan applied to the S&P 500
“Trade Breakouts And Retracements With TMV.” The article components to find stocks where ADX is rising, CCI is above
also makes use of the CCI and Keltner studies, which are its zero line, and price is above the upper Keltner channel.
common studies provided within the eSignal application. The scan returned 81 stocks that were in strong trends. The
The CCI can be found as a built-in study or EFS under the green and red checks in the watchlist columns tell you when
Formulas\Built-in Studies\ folder. For the Keltner, please price is above (green) or below (red) its eight-period moving
use QCharts_Keltner.efs found in the Formulas\Bands and average.
Channels\ folder. Note: Keltner channels in TC2000.com use the Raschke
The ADX study contains formula parameters to set the val- method, where channel width is a multiple of average true
ues for the ADX period, ADX smoothing, MA period and range. But the channels can also be plotted as described in
MA type, which may be configured through the Edit Chart Star’s article by adding a custom PCF channel indicator to
window (right-click on the chart and select Edit Chart). The the price pane. The indicator line formula for typical price is
volume peaks study also contains formula parameters (short (H+L+C)/3 and the channel width formula is H-L, with the
volume average period, long volume average period, and lev- smoothing period set to 20.
el %) that may be customized through the Edit Chart window The third watchlist column marks stocks where the percent
as well. volume oscillator (short period 1, long period 20) is spiking
To discuss this study or download complete copies of the above 50, so you can see stocks with unusual volume activity
formula code, please visit the EFS Library Discussion Board like URBN and VMC.
forum under the forums link from the support menu at www. Using the new alert monitoring service, you can be alerted
esignal.com or visit our EFS KnowledgeBase at www.esig- when a stock passes a TMV scan; is breaking above the up-
nal.com/support/kb/efs/. The eSignal formula scripts (EFS) per Keltner channel on unusual volume; is pulling back into
are also available for copying and pasting from the Stocks the channel; and so on. You can set alerts on price or any
& Commodities website at www.traders.com. indicator on the chart and have it monitored while you’re
Copyright © Technical Analysis Inc.
Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

away from your computer. You can be alerted by email or


text message sent to your mobile device. Alerts can be set on
individual stocks or on lists of stocks.
For more information on TC2000 or to start a free trial,
visit www.TC2000.com.
—Patrick Argo
Worden Brothers, Inc.
www.Worden.com

F WEALTH-LAB: trend, momentum, volatility, and Figure 6: WEALTH-LAB, COLOR-CODED PRICE BARS. This sample Wealth-Lab
volume (TMV) 6.3 chart displays the highlighting according to the TMV template using daily data of
Provided here is the C# code for Wealth-Lab 6 that plots the crude oil futures. The bottom pane shows the volume oscillator (OscV) presented in
indicators and performs the color highlighting described by Barbara Star’s article in this issue.
Barbara Star in her article in this issue, “Trade Breakouts And
Retracements With TMV.” Count; bar++)
The Wealth-Lab strategy is available for instant download {
bool adxPriceRising = adx[bar] > adx[bar-1] &&
from Wealth-Lab’s Open Strategy dialog. Keep in mind that Close[bar] > sma[bar];
the breakout and retracement opportunities suggested by the bool adxPriceFalling = adx[bar] > adx[bar-1] &&
template are to be found in trending markets. Close[bar] < sma[bar];

A sample chart implementation is shown in Figure 6. if( adxPriceRising )
SetBarColor( bar, Color.LightGreen );
C# code: else
if( adxPriceFalling )
using System; SetBarColor( bar, Color.Red );
using System.Collections.Generic; }
using System.Text; }
using System.Drawing; }
using WealthLab; }
using WealthLab.Indicators;
—Eugene
namespace WealthLab.Strategies
{
www.wealth-lab.com
public class TMV_1202Star : WealthScript
{
protected override void Execute()
{
DataSeries K1 = KeltnerLower.Series( Bars, 13, 13 );
DataSeries K2 = KeltnerUpper.Series( Bars, 13, 13 );
F AMIBROKER: trend, momentum, volatility, and
ADX adx = ADX.Series( Bars,10 ); volume (TMV)
SMA sma = SMA.Series( Close,8 ); In “Trade Breakouts And Retracements With TMV” in this
DataSeries OscV =
(SMA.Series( Volume,20 ) - Volume)/SMA.Series( issue, author Barbara Star presents a simple trading template
Volume,20 ) * 100; consisting of Keltner channels, CCI, and color-coded price
OscV.Description = «Volume Oscillator»; bars.
DataSeries cci = CCI.Series( Bars, 13 );
A ready-to-use formula based on the article is presented
ChartPane cPane = CreatePane( 30, true, true ); here. To use it, enter the formula in the AFL Editor and then
ChartPane oPane = CreatePane( 30, false, true ); press the Insert Indicator button to see the chart. Right-click
SetBarColors( Color.DarkGray,Color.DarkGray );
PlotSeries( PricePane, SMA.Series( Close,13 ), Color. on the chart and select “parameters” to adjust the smoothing
Red, LineStyle.Solid, 1); period.
PlotSeriesFillBand( PricePane, K1, K2, Color.Red, Color.
Empty, LineStyle.Solid, 1); AmiBroker code listing
PlotSeriesOscillator( oPane, OscV, 50, -50, Color.Blue,
Color.Red, Periods = Param("Periods", 13, 2, 300, 1 );
Color.Empty, LineStyle.Histogram, 2);
PlotSeries( oPane, OscV, Color.Black, LineStyle.Solid, 2); P = ( H + L + C )/3;
PlotSeries( cPane, cci, Color.Purple, LineStyle.Histo-
gram, 3 ); CenterLine = MA( P, Periods );
DrawHorzLine( cPane, -100, Color.Red, LineStyle. KTop = CenterLine + MA( H - L, Periods );
Dashed, 1 ); KBot = CenterLine - MA( H - L, Periods );
DrawHorzLine( cPane, 100, Color.Blue, LineStyle.
Dashed, 1 ); Plot( CenterLine, "MA" + _PARAM_VALUES(), colorRed );
Plot( KTop, "KBTop" + _PARAM_VALUES(), colorRed );
for(int bar = GetTradingLoopStartBar(30); bar < Bars. Plot( KBot, "KBBot" + _PARAM_VALUES(), colorRed );

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

Figure 8: NEUROSHELL TRADER, ADX, CCI, and Keltner channels. This


sample NeuroShell Trader chart shows the TMV indicators.
Figure 7: AMIBROKER, KELTNER CHANNEL AND CCI. Here is a daily chart of
BIDU with a Keltner channel overlay and color-coded price bars in the lower pane
and CCI in the upper pane. CCI
CCI( High, Low, Close, 13, 0.015 )
Color = IIf( ADX( 10 ) > Ref( ADX( 10 ), -1 ) AND C > MA( C, 8 ),
Volume oscillator
colorGreen,
IIf( ADX( 10 ) > Ref( ADX( 10 ), -1 ) AND C < MA( C, 8 ), col- Multiply2( 100, Sub(Divide(Volume, MovAvg(Volume,20)), 1) )
orRed, colorBlack ) );

Plot( C, "Price", Color, styleBar | styleThick );


Users of NeuroShell Trader can go to the Stocks & Com-
modities section of the NeuroShell Trader free technical
A sample chart is shown in Figure 7. support website to download a copy of this or any previous
—Tomasz Janeczko, AmiBroker.com Traders’ Tips.
www.amibroker.com A sample chart is shown in Figure 8.
—Marge Sherald, Ward Systems Group, Inc.
301 662-7950, sales@wardsystems.com
www.neuroshell.com
F NEUROSHELL TRADER: trend, momentum,
volatility, and volume (TMV)
The TMV indicators described by Barbara Star in
F AIQ: trend, momentum, volatility, and
her article in this issue, “Trade Breakouts And Retracements
volume (TMV)
With TMV,” can be easily implemented with a few of Neuro-
The AIQ code and EDS file based on Barbara Star’s
Shell Trader’s 800+ indicators. Simply select “New Indicator”
article in this issue, “Trade Breakouts And Retracements
from the Insert menu and use the Indicator Wizard to set up
With TMV,” is provided at www.TradersEdgeSystems.com/
the following indicators:
traderstips.htm.
Keltner channel middle line:
Figure 9 shows a chart of Noble Energy along with the
MovAvg( Divide( Add3( High, Low, Close), 3), 13) TMV indicators.

Keltner channel upper line: !TRADE BREAKOUTS AND RETRACEMENTS WITH TMV
Add2( MovAvg( Divide( Add3( High, Low, Close), 3), 13), !Author: Barbara Star,PhD, TASC February 2012
MovAvg(Sub( High, Low), 13) ) !Coded by: Richard Denning 12/9/2011
!www.TradersEdgeSystems.com
Keltner channel lower line:
Sub( MovAvg( Divide( Add3( High, Low, Close), 3), 13), MovAvg(Sub( !CODING ABREVIATIONS:
C is [close].
High, Low), 13) )
C1 is valresult(C,1).
O is [open].
ADX price rising H is [high].
And2( A>B( Momentum( ADX(High, Low, Close, 10, 10), 1), 0 ), L is [low].
A>B( Close, MovAvg(Close,8) ) ) H1 is valresult(H,1).
L1 is valresult(L,1).
ADX price falling V is [volume].
And2( A>B( Momentum( ADX(High, Low, Close, 10, 10), 1), 0 ),
A<B( Close, MovAvg(Close,8) ) ) !KELTNER CHANNEL
!INPUT:

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

Figure 9: AIQ SYSTEMS, Keltner channels, CCI, and color-coded


price bars. Here’s a sample chart of Noble Energy with the TMV indicators.
Figure 10: TRADERSSTUDIO, Keltner channels, CCI, and color-coded
keltLen is 20. price bars. This chart shows the TMV indicators on a chart of QQQQ from April
!KELTNER CHANNEL UDFs: to December 2006.
typ is (H+L+C)/3.
rangeAvg is simpleavg(H-L,keltLen).
!Plot the following three functions on price chart volAvg2 is simpleavg(V,volLen2).
!as three separte indicators: pctChgV is (volAvg1 / volAvg2 -1) * 100.
midKelt is simpleavg(typ,keltLen). volOsc is iff(abs(pctChgV)>pctChgLvl,1,0). !PLOT
upperKelt is midKelt + rangeAvg.
lowerKelt is midKelt - rangeAvg. !CCI INDICATOR:
!INPUTS:
!ADX cciLen is 13.
!INPUT: !CCI UDFs:
WilderLen is 10. typAvg is simpleavg(typ,cciLen).
!NOTE: Wilder to expontential averaging the formula is: absdiff is abs(typ-typAvg).
!Wilder length * 2 -1 = exponential averaging length sumD is sum(absdiff,cciLen)/ cciLen.
CCI is (typ - typAvg) / (0.015 * sumD). !PLOT WITH +100 -100
!USED FOR DMI, ATR, ADX, ADX RATE LINES
avgLen is WilderLen * 2 - 1.
!COLOR BAR RULES:
!AVERAGE TRUE RANGE: !INPUT:
TR is Max(H-L,max(abs(C1-L),abs(C1-H))). trndLen is 8.
Green if ADX > valresult(ADX,1) and C > simpleavg(C,trndLen).
ATR is expAvg(TR,avgLen). Red if ADX > valresult(ADX,1) and C < simpleavg(C,trndLen).
ATRpct is expavg(TR / C,avgLen) * 100.
—Richard Denning
!+DM -DM CODE:
rhigh is (H-H1). info@TradersEdgeSystems.com
rlow is (L1-L). for AIQ Systems
DMplus is iff(rhigh > 0 and rhigh > rlow, rhigh, 0).
DMminus is iff(rlow > 0 and rlow >= rhigh, rlow, 0).
AvgPlusDM is expAvg(DMplus,avgLen).
AvgMinusDM is expavg(DMminus,avgLen).
F TRADERSSTUDIO: TRADE BREAKOUTS AND
!DMI CODE:
PlusDMI is (AvgPlusDM/ATR)*100. !PLOT (2 lines) RETRACEMENTS WITH TMV
MinusDMI is AvgMinusDM/ATR*100. !PLOT (2 lines). The TradersStudio code for Barbara Star’s article in this
DirMov is PlusDMI - MinusDMI. issue, “Trade Breakouts And Retracements With TMV,” is
DirMovAIQ is [dirMov].
provided at www.TradersEdgeSystems.com/traderstips.htm.
!ADX INDICATOR as defined by Wells Wilder The download includes following code files:
!PLOT DIdiff as historigram is same as DirMov (AIQ built in
indicator):
DIdiff is PlusDMI-MinusDMI. • Function: “VOLUME_OSC” computes the indicator values
ZERO if PlusDMI = 0 and MinusDMI =0. for the volume oscillator.
DIsum is PlusDMI+MinusDMI. • Indicator Plot: “VOLUME_OSC_IND” for displaying the
DX is iff(ZERO,100,abs(DIdiff)/DIsum*100).
!PLOT ADX as single line indicator with support at 24: volume oscillator indicator.
ADX is expavg(DX,avgLen). • Indicator Plot: “theADX” for displaying the ADX indicator
with a fixed level of 24.
!VOLUME OSCILLATOR: • Indicator Plot: “KELTNER_BANDS” for displaying the
!INPUTS:
volLen1 is 1. Keltner bands.
volLen2 is 20. • Indicator Plot: “TMV_COLOR_BAR_IND” for coloring
pctChgLvl is 50. the bars green or red per the author’s trend direction and
!VOLUME OSCILLATOR UDFs:
volAvg1 is simpleavg(V,volLen1). ADX change criteria.

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

In Figure 10, I show a chart of the NASDAQ 100 ETF


(QQQQ) from April to December 2006. During this period,
we have both a downtrend and an uptrend.

'TRADE BREAKOUTS AND RETRACEMENTS WITH TMV


'Author: Barbara Star,PhD, TASC February 2012
'Coded by: Richard Denning 12/9/2011
'www.TradersEdgeSystems.com

'-----------------------------------------------------
'VOLUME OSCILLATOR
Function VOLUME_OSC(volLen1,volLen2,pctChgLevel)
Dim volAvg1 As BarArray
Dim volAvg2 As BarArray
Dim pctChgV As BarArray
volAvg1 = Average(V,volLen1)
volAvg2 = Average(V,volLen2) Figure 11: NINJATRADER, trend, momentum, volatility, and volume
If volAvg2<>0 Then pctChgV = (volAvg1/volAvg2-1)*100 (TMV). This sample NinjaTrader chart shows the TMV indicator applied to a 15-minute
VOLUME_OSC = IIF(Abs(pctChgV)>pctChgLevel,1,0) chart of emini S&P (ES 03-12).
End Function
'-----------------------------------------------------
'VOLUME OSCILLATOR INDICATOR And Retracements With TMV” by Barbara Star in this issue,
Sub VOLUME_OSC_IND(volLen1,volLen2,pctChgLevel) has been implemented as an indicator available for download
plot1(VOLUME_OSC(volLen1,volLen2,pctChgLevel))
End Sub at www.ninjatrader.com/SC/February2012SC.zip.
'----------------------------------------------------- Once you have downloaded it, from within the NinjaTrad-
'ADX INDICATOR (CUSTOM) er Control Center window, select the menu File → Utilities →
sub theADX(adxLen)
plot1(adx(adxLen,0)) Import NinjaScript and select the downloaded file. This file is
Plot2(24) for NinjaTrader version 7 or greater.
End Sub You can review the indicator source code by selecting the
'-----------------------------------------------------
'KELTNER BANDS menu Tools → Edit NinjaScript → Indicator from within the
Sub KELTNER_BANDS(kLen) NinjaTrader Control Center window and selecting TMV.
Dim typ As BarArray NinjaScript uses compiled DLLs that run native, not in-
Dim avgRange As BarArray
Dim midKeltner As BarArray terpreted, which provides you with the highest performance
Dim upperKeltner As BarArray possible.
Dim lowerKeltner As BarArray
typ = (H+L+C)/3
A sample chart implementing the strategy is shown in Fig-
avgRange = Average(H-L,kLen) ure 11.
midKeltner = Average(typ,kLen) —Raymond Deux & Ryan Millard
upperKeltner = midKeltner + avgRange NinjaTrader, LLC
lowerKeltner = midKeltner - avgRange www.ninjatrader.com
plot1(upperKeltner)
plot2(lowerKeltner)
End Sub
'----------------------------------------------------- F TRADECISION: trend, momentum,
'TMV COLOR BAR INDICATOR
Sub TMV_COLOR_BAR_IND(adxLen,trendLen)
volatility, and volume (TMV)
Dim myADX As BarArray The article by Barbara Star in this issue, “Trade Breakouts
myADX = ADX(adxLen,0) And Retracements With TMV,” demonstrates how to combine
If myADX > myADX[1] And C > Average(C,trendLen) Then
BarColor(0) = vbGreen
trend, momentum, volatility, and volume indicators to cut
End If through the market noise. Since Tradecision does not sup-
If myADX > myADX[1] And C < Average(C,trendLen) Then port bar highlighting functionality, we developed a trading
BarColor(0) = vbRed
End If strategy to visualize the TMV technique that includes ADX
End Sub and moving average movements.
'----------------------------------------------------- Using Tradecision’s Indicator Builder, create the follow-
ing indicators:
—Richard Denning
info@TradersEdgeSystems.com KELTNER indicator:
for TradersStudio input
Length:"Number of Periods:", 13,2,500;
end_input
var
Keltner:=0;
end_var
F NINJATRADER: trend, momentum, volatility, and
Keltner:= Mov((H+L+C)/3,Length,S);
volume (TMV)
return Keltner;
The TMV trading template, as presented in “Trade Breakouts

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

F TRADINGSOLUTIONS: TRADE BREAKOUTS AND


RETRACEMENTS WITH TMV
In “Trade Breakouts And Retracements With TMV” in this
issue, author Barbara Star provides an overview of the indica-
tors she uses for chart analysis.
These functions are described below in TradingSolutions
formula language and are also available as a function file
that can be downloaded from the TradingSolutions website
FIGURE 12: TRADECISION, NASDAQ COMPOSITE INDEX WITH THE TMV (www.tradingsolutions.com) in the Free Systems section. As
STRATEGY. The Keltner channel, commodity channel index, TMV strategy, and vol- with many indicators, these functions could make good in-
ume oscillator are plotted here on a daily ^IXIC chart. The volume oscillator is above
zero when its value is higher than 50%.
puts to neural network predictions.

Function Name: Keltner Channel (Middle, Original Version)


KELTNER top: Short Name: OrigKeltner Middle
Inputs: Close, High, Low, Period
input MA (Typical (Close, High, Low), Period)
Length:"Number of Periods:", 13,2,500;
end_input Function Name: Keltner Channel (Top, Original Version)
var Short Name: OrigKeltner Top
Keltner:=0; Inputs: Close, High, Low, Period
end_var Add (MA (Typical (Close, High, Low), Period), MA (Sub (High,
Low), Period))
Keltner:= Mov((H+L+C)/3,Length,S)+ Mov((H-L),Length,S) ;
return Keltner; Function Name: Keltner Channel (Bottom, Original Version)
Short Name: OrigKeltner Bottom
Inputs: Close, High, Low, Period
KELTNER bottom: Subtract (MA (Typical (Close, High, Low), Period), MA (Sub (High,
input Low), Period))
Length:"Number of Periods:", 13,2,500;
end_input Function Name: ADX Price Rising
Short Name: ADXRising
var Inputs: Close, High, Low
Keltner:=0; And (Inc (ADX (Close, High, Low, 10, 10)), GT (Close, MA (Close,
end_var 8)))
Keltner:= Mov((H+L+C)/3,Length,S) - Mov((H-L),Length,S) ;
Function Name: ADX Price Falling
return Keltner; Short Name: ADXFalling
Inputs: Close, High, Low
Volume Oscillator: And (Inc (ADX (Close, High, Low, 10, 10)), LT (Close, MA (Close,
8)))
return iff(OSCV(1,20,S,PERCENT)>50,1,0);
Function Name: Volume Oscillator
Using Tradecision’s Strategy Builder, create the TMV Short Name: OscV
Inputs: Volume
strategy using the following formulas: GT (Osc (Volume, 1, 20, 1), 50)

Entry Long —Gary Geniesse, NeuroDimension, Inc.


return ADX(10)>ADX(10)\1\ AND C>Mov(C,8,S); 800 634-3327, 352 377-5144
www.tradingsolutions.com
Exit Long
return ADX(10)>ADX(10)\1\ AND C>Mov(C,8,S);

Entry Short
return ADX(10)>ADX(10)\1\ AND C<Mov(C,8,S);

Exit Short
return C<=Mov(C,8,S);
F TRADE NAVIGATOR: TRADE BREAKOUTS AND
To import the strategy into Tradecision, visit the area “Trad- RETRACEMENTS
ers’ Tips from TASC Magazine” at www.tradecision.com/ Trade Navigator offers everything needed for recreating
support/tasc_tips/tasc_traders_tips.htm or copy the code from the indicators discussed by author Barbara Star in “Trade
the Stocks & Commodities website at www.Traders.com. Breakouts And Retracements With TMV” in this issue, and
A sample chart is shown in Figure 12. some of the indicators and highlight bars come standard with
—Yana Timofeeva, Alyuda Research Trade Navigator.
510 931-7808, sales@tradecision.com You can recreate the custom indicators and highlight bars
www.tradecision.com in Trade Navigator using the following TradeSense code.

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

Figure 14: VT TRADER, ADX, CCI, and Keltner BANDS. Here is the TMV
Figure 13: TRADE NAVIGATOR, TMV template attached to a EUR/USD one-hour candlestick chart.

First, open the Trader’s Toolbox, click on the Functions


tab, and click the New button.
For the ADX price rising indicator, input the following
code: F VT TRADER: trend, momentum, volatility, and
volume (TMV)
ADX price rising Our Traders’ Tip this month is based on Barbara Star’s ar-
ADX (10 , False) > ADX (10 , False).1 And Close > MovingAvg
(Close , 8) ticle in this issue, “Trade Breakouts And Retracements With
TMV. ”
Click the verify button. When you are finished, click the save This trading system template based on the one described
button, type a name for your new function, and click OK. in Star’s article combines trend, momentum, and volatility
Repeat these steps for the ADX price falling, Linda Ra- indicators into an easy-to-use format, providing the trader
schke lower line, Linda Raschke upper line, and Linda Ra- with a multidimensional perspective of price behavior. Our
schke middle line indicators. version of the TMV includes Keltner bands, CCI, and ADX.
The volume oscillator was not included. Since the TMV is an
ADX price falling analytic template made up of a series of indicators, traders
ADX (10 , False) > ADX (10 , False).1 And Close < MovingAvg
(Close , 8) are encouraged to experiment with their own mix of indica-
tors. For additional information regarding the use of TMV,
Linda Raschke lower line please refer to Star’s article.
MovingAvgX (Close , 20 , False) - (2.5 * Avg True Range (10))
We’ll be offering the TMV analytic template for download
Linda Raschke upper line in our VT client forums at http://forum.vtsystems.com along
MovingAvgX (Close , 20 , False) + (2.5 * Avg True Range (10)) with hundreds of other precoded and free indicators and trad-
Linda Raschke middle line ing systems. The VT Trader step-by-step instructions for rec-
MovingAvgX (Close , 20 , False) reating this analytic template are shown at www.traders.com,
with the main formula shown here:
For step-by-step instructions on adding the function, indi-
cators, and highlight bars to a Trade Navigator chart, see the {Keltner Channels}

Traders’ Tips area of www.traders.com. MidKC:= Mov(TP(),KcPr,S);


UpperKC:= MidKC + Mov((H-L),KcPr,S);
Genesis Financial Technologies has provided a library LowerKC:= MidKC - Mov((H-L),KcPr,S);
named “Trade Breakouts And Retracements With TMV” that
includes a template named “SC Trade Breakouts And Re- {Commodity Channel Index}
tracements With TMV,” which contains the custom indicators CCIndex:= CCI(cciperiods);
and highlight bars from discussed here. You can download a CCIUpExtreme:= 100;
CCIDownExtreme:= -100;
special file named SC201202, downloadable through Trade CCIZero:= 0;
Navigator, to get this library.
A sample chart is shown in Figure 13. {Average Directional Movement Index (ADX)}
—Michael Herman TH:= if(Ref(C,-1)>H,Ref(C,-1),H);
Genesis Financial Technologies TL:= if(Ref(C,-1)<L,Ref(C,-1),L);
www.TradeNavigator.com TR:= TH-TL;

PlusDM:= if(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),


if(H>Ref(H,-1) AND L<Ref(L,-1) AND H-Ref(H,-1)>Ref(L,-1)-
L, H-Ref(H,-1),

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

0));

PlusDI:= 100 * Wilders(PlusDM,AdxPeriods)/


Wilders(Tr,AdxPeriods);

MinusDM:= if(L<Ref(L,-1) AND H<=Ref(H,-1), Ref(L,-1)-L,


if(H>Ref(H,-1) AND L<Ref(L,-1) AND H-Ref(H,-1)<Ref(L,-
1)-L, Ref(L,-1)-L,
0));

MinusDI:= 100 * Wilders(MinusDM,AdxPeriods)/


Wilders(Tr,AdxPeriods);

DIDif:= Abs(PlusDI-MinusDI);
DISum:= PlusDI + MinusDI;

_ADX:= 100 * Wilders(DIDif/DISum,AdxPeriods);

{ADX/Price Paint Bars Conditions}

AdxPriceRising:= _ADX>ref(_ADX,-1) AND C>Mov(C,8,S); FIGURE 15: TRADESIGNALONLINE.COM, KELTNER CHANNEL AND VOLUME OS-
AdxPriceFalling:= _ADX>ref(_ADX,-1) AND C<Mov(C,8,S); CILLATOR. Here is an example chart from Tradesignal Online displaying the eKeltner
channel and volume oscillator indicator on a daily chart of the S&P 500 index.
To attach the trading system to a chart (Figure 14), select
the “Add trading system” option from the chart’s contextual Inputs:
menu, select “TASC - 02/2012 - TMV Analytic Template”    Period( 20 ),
   Factor_ATR( 2.5 );
from the trading systems list, and click the [Add] button.
To learn more about VT Trader, visit www.vtsystems. Vars:
com.    midLine, atrValue, upperLine, lowerLine;
Risk disclaimer: Forex trading involves a substantial risk of loss
midLine = XAverage( TypicalPrice, 20 );
and may not be suitable for all investors. atrValue = Average( TrueRAnge, 20 );
—Chris Skidmore upperLine = midLine + atrValue * Factor_ATR;
Visual Trading Systems, LLC lowerLine = midLine - atrValue * Factor_ATR;
212 871-1747, info@vtsystems.com
www.vtsystems.com DrawLine( midLine, "Mid Line", StyleDash, 1, Black );
DrawLine( upperLine, "Upper Line", StyleSolid, 1, Black );
DrawLine( lowerLine, "Lower Line", StyleSolid, 1, Black );

// *** Copyright tradesignal GmbH ***


// *** www.tradesignal.com ***
F Tradesignal: trend, momentum, volatility, and
volume (TMV)
The indicators discussed in “Trade Breakouts And Retrace- Source code for the «sKeltner Channel»-indicator

ments With TMV” by Barbara Star in this issue can be used Meta:
with our online charting tool at www.tradesignalonline.com.    Synopsis("This Keltner channel variation was derived from
Barbara Stars article 'Trading with TMV' in the 02/2012 issue of
Check the Infopedia section for our Lexicon. There you will Technical Analysis of Stocks & Commodities"),
see the indicator and functions that you can make available    Weblink("http://www.tradesignalonline.com/lexicon/view.
for your personal account. Click on an indicator and select aspx?id=Trade%20Breakouts%20and%20Retracements%20
with%20TMV"),
“Open script.” The indicator will immediately be available    Subchart( False );
for you to apply on any chart. (See Figure 15.)
—Henning Blumenthal Inputs:
Tradesignal GmbH    Period( 20 );
support@tradesignalonline.com
Vars:
www.TradesignalOnline.com, www.Tradesignal.com    midLine, atrValue, upperLine, lowerLine;

TradeSignalOnline source code for the “eKeltner Channel” midLine = AverageFC( TypicalPrice, 20 );
indicator: atrValue = Average( Range, 20 );
upperLine = midLine + atrValue;
lowerLine = midLine - atrValue;
Meta:
   Synopsis("This original Keltner channel was derived from
DrawLine( midLine, "Mid Line", StyleDash, 1, Black );
Barbara Stars article 'Trading with TMV' in the 02/2012 issue of
DrawLine( upperLine, "Upper Line", StyleSolid, 1, Black );
Technical Analysis of Stocks & Commodities"),
DrawLine( lowerLine, "Lower Line", StyleSolid, 1, Black );
   Weblink("http://www.tradesignalonline.com/lexicon/view.
aspx?id=Trade%20Breakouts%20and%20Retracements%20
// *** Copyright tradesignal GmbH ***
with%20TMV"),
// *** www.tradesignal.com ***
   Subchart( False );

Copyright © Technical Analysis Inc.


Stocks & Commodities V. 30:2 (61-70): Traders’ Tips by Technical Analysis, Inc.

Source code for the "Volume Oscillator"-indicator Source code for the "ADX Color Bars"-indicator

Meta: Meta:
Synopsis("This Indicator was derived from Barbara Stars ar-    Synopsis("This indicator was derived from Barbara Stars article
ticle 'Trading with TMV' in the 02/2012 issue of Technical Analysis 'Trading with TMV' in the 02/2012 issue of Technical Analysis of
of Stocks & Commodities"), Stocks & Commodities"),
Weblink("http://www.tradesignalonline.com/lexicon/view.    Weblink("http://www.tradesignalonline.com/lexicon/view.
aspx?id=Trade%20Breakouts%20and%20Retracements%20 aspx?id=Trade%20Breakouts%20and%20Retracements%20
with%20TMV"), with%20TMV"),
Subchart( True );    Subchart( False );

Inputs: Inputs:
Fast_Period( 1 , 1 ),    ADX_Period( 10 , 1 ),
Slow_Period( 20 , 1 ),    SMA_Period( 8 , 1 ),
Peak_Level( 10 , 1 );    Color_Bullish( DarkGreen ),
   Color_Bearish( Red ),
   Color_Neutral( White );
Vars:
volValue, fastAvgValue, slowAVGValue; Vars:
   longCond, shortCond, barColor, adxValue, smaValue;
fastAvgValue = AverageFC( Volume, Fast_Period );
slowAVGValue = AverageFC( Volume, Slow_Period ); adxValue = ADX( ADX_Period );
smaValue = Average( Close, SMA_Period );
volValue = ( ( fastAvgValue - slowAVGValue ) / ( fastAvgValue +
slowAVGValue ) ) * 100; longCond = adxValue > adxValue[1] And Close > smaValue;
shortCond = adxValue < adxValue[1] And Close < smaValue;
If volValue > Peak_Level Then
DrawForest( 0, volValue, "Zero", "Vol OSc", Thick, Black ); barColor = Color_Neutral;

DrawLine( 0, "Baseline", StyleDash, 1, Black ); if longCond Then


   barColor = Color_Bullish
// *** Copyright tradesignal GmbH *** Else If shortCond Then
// *** www.tradesignal.com ***    barColor = Color_Bearish;

DrawCandleStick( Open, High, Low, Close, barColor,


barColor, DarkGray );

// *** Copyright tradesignal GmbH ***


// *** www.tradesignal.com ***

Find the complete collection of Traders’ Tips and code at our


website, www.Traders.com, in the Traders’ Tips section at:
http://www.traders.com/index.php/sac-magazine/departments/traders-tips

Copyright © Technical Analysis Inc.


We are honored to be recognized as a
top trading software provider in the
2022 Readers’ Choice Awards.

WINNER: Stand Alone Analytical Software $$$


WINNER: Stand Alone Analytical Software $

Thank you to all who voted for NinjaTrader’s industry


leading platform & brokerage services.
Futures, foreign currency and options trading contains substantial risk and is not for every
investor. Only risk capital should be used for trading and only those with sufficient risk capital
should consider trading.

ninjatrader.com
How much interest is
your broker paying you?

Interactive Brokers
pays up to 3.83% on idle cash
in your brokerage account 1

Broker Interest Rate

Interactive Brokers
2
3.83%

E-Trade 0.01%

Fidelity 1.94%

Schwab 0.45%

TD Ameritrade 0.35%

ibkr.com/moreinterest

Member NYSE, FINRA, SIPC. Supporting documentation for any claims and statistical information will be provided upon request. Competitor rates and offers
subject to change without notice. Services vary by firm. [1] Credit interest rates as of 01/04/2023. [2] Rate shown applies to IBKR Pro clients only. USD credit
interest is paid at the stated rate on balances over USD 10,000 in securities accounts with NAV exceeding USD 100,000. Accounts with less than 100,000
NAV will receive USD credit interest at rates proportional to the size of the account. For more information, see ibkr.com/interestpaid
01-IB23-1592CH1591
subscribe or renew today!
Every Stocks & Commodities subscription
(regular and digital) includes:
• Full access to our Digital Edition
The complete magazine as a PDF you can download.
• Full access to our Digital Archives 8999
1 year.................
$
That’s 35 years’ worth of content!

2 years............ 149
• Complete access to WorkingMoney.com $ 99
The information you need to invest smartly and successfully.

3 years............ 199
• Access to Traders.com Advantage $ 99
Insights, tips and techniques that can help you trade smarter.

PROFESSIONAL TRADERS’ STARTER KIT


A 5-year subscription to S&C magazine that includes
everything above PLUS a free* book, Charting The Stock
Market: The Wyckoff Method, all for a price that saves
you $150 off the year-by-year price! *Shipping & han-
dling charges apply for foreign orders.

5 years..........
$
29999
That’s around $5 a month!

Visit www.Traders.com to find out more!


Email: Circ@Traders.com • Phone: 206-938-0570 facebook.com/STOCKSandCOMMODITIES @STOCKSandCOMM

You might also like