Oct 10, 2017 | Charts, EDS, EDS code, indicators, jay kaeppel
First the Bad News: There are no “magic bullets” when it comes to trading. There are people in this industry who have literally tested somewhere in the range of six bazillion “indicators” – give or take (“Hi. My name is Jay”). Every trend following indicator looks like a gold mine when it latches onto a huge trend and rides it (but not so much when it starts getting whipsawed). And every overbought/oversold indicator looks like a gift from heaven from time to time when it somehow manages to peak (or valley) and then reverses right at a high (or low). And then the next time the thing gets oversold the security in question just keeps plunging and the previously “amazingly accurate” indicator just gets more and more oversold.
Bottom line: what I am about to discuss is likely no better or worse than a lot of other indicators. And it is no holy grail. Still, I kinda like it – or whatever that is worth.
EDITORS NOTE an WinWay EDS file for this indicator with the 3 step rules outlined can be downloaded from here you will need to copy or save this file into your wintes32/eds strategies folder. Alternatively the code is available at the end of this article for copying and pasting into a new EDS file.
UpDays20
I call this indicator UpDays20 and I stole, er, learned it originally from Tom McClellan of McLellan Financial Publications. My calculation may be slightly different because I wanted an indicator that can go both positive and negative.
For a given security look at its trading gains and losses over the latest 20 trading days.
UPDays20 = (Total # of Up days over the last 20 trading days) – 10
So if 10 of the last 20 trading days showed a gain then UpDays20 would read exactly 0.
If only 6 of the last 20 trading days showed a gain then UpDays20 would read -4
You get the idea (and proving once again that it “doesn’t have to be rocket science”). As a “trading method” it is always advised that this indicator – like most all other indicators – NOT be used as a standalone approach to trading. That being said, the way I follow this indicator is as follows.
Step 1) UpDays20 drops to at least -2
Step 2) UpDays20 rises 2 points from a low
Step 3) The security in question then rises above its high for the previous 2 trading days
It is preferable to follow this setup hen the security in question is above its 200-day moving average, but that is up to the trader to decide (the danger to using this with a security below its 200-day moving average is that it might just be in the middle of a freefall. The upside is that counter trend rallies can be fast and furious – even if sometimes short-lived).
Again, there is nothing magic about these particular steps. They are simply designed to do the following:
1) Identify an oversold condition
2) Wait for some of the selling pressure to abate
3) Wait for the security to show some sign of reversing to the upside
Like just about every other indicator/method, sometimes it is uncannily accurate and sometimes it is embarrassingly wrong (hence the reason experienced traders understand that capital allocation and risk management are far more important than the actually method you use to enter trades).
In this previous article (in Figures 3 and 4) I wrote about using this indicator with ticker TLT. Figure 1 and 2 display the “buy” signals generated using the rules above for tickers IYT and GLD.

Figure 1 – UpDays20 “Buy” Alerts for ticker IYT (Courtesy TradingExpert)

Figure 2 – UpDays20 “Buy” Alerts for ticker GLD (Courtesy TradingExpert)
Are these signals good or bad? That is in the eye of the beholder and not for me to say. One big unanswered question is “when do you exit”? That is beyond the scope of this “idea” article – however, “sell some at the first good profit and then use a trailing stop” looks like a decent approach to consider) but would have a profound effect on any actual trading results.
Some of the signals displayed in Figures 1 and 2 are obviously great, others are maybe not so hot. Interestingly, some of the signals in Figure 1 and 2 that don’t look to timely at first blush actually offered a profitable opportunity to a trader who was inclined to take a quick profit. Again, how you allocate capital and when you exit with a profit and when you exit with a loss would likely have as much impact on results as the raw “buy” signals themselves.
Summary
No one should go out and start trying to trade tomorrow based on UpDays20. No claim is being made that the steps detailed herein will result in profits nor even that this is a good way to trade.
But, hey, it’s one way.
Jay Kaeppel Chief Market Analyst at JayOnTheMarkets.com and TradingExpert Pro client.
Disclaimer: The data presented herein were obtained from various third-party sources. While I believe the data to be reliable, no representation is made as to, and no responsibility, warranty or liability is accepted for the accuracy or completeness of such information. The information, opinions and ideas expressed herein are for informational and educational purposes only and do not constitute and should not be construed as investment advice, an advertisement or offering of investment advisory services, or an offer to sell or a solicitation to buy any security.
EDITORS NOTE an WinWay EDS file for this indicator with the 3 step rules outlined can be downloaded from here you will need to copy or save this file into your wintes32/eds strategies folder. Alternatively the code is available at the end of this article for copying and pasting into a new EDS file.
! UpDays20 – I call this indicator UpDays20. For a given security look at its trading gains and losses over the latest 20 trading days.
! UPDays20 = (Total # of Up days over the last 20 trading days) – 10!
So if 10 of the last 20 trading days showed a gain then UpDays20 would read exactly 0.
! If only 6 of the last 20 trading days showed a gain then UpDays20 would read -4
Upday if [close]>val([close],1).
totalupdayslast20days is CountOf(upday,20).
updayindicator is totalupdayslast20days – 10.
! How to follow this indicator
! Step 1) UpDays20 drops to at least -2
! Step 2) UpDays20 rises 2 points from a low
! Step 3) The security in question then rises above its high for the previous 2 trading days
UpDays20rises2points if updayindicator>valresult(updayindicator,1) and valresult(updayindicator,1)>valresult(updayindicator,2).
updays20atminus2orlower if valresult(updayindicator,2)<=-2.
closesabovehighof2priordays if [close]>val([high],1) and [close]>val([high],2).
Upsignal if UpDays20rises2points and updays20atminus2orlower and closesabovehighof2priordays.
Apr 28, 2017 | Charts, Market Charts, Support
Action keys
A Toggle vertical date cursor line to a diamond and back
D Quick-change the date
G Toggle grid lines on or off
F Display fundamental information
W Toggle between daily and weekly data
M Toggle trendline drawing on or off (also crosshairs)
S Process a stock split or mutual fund distribution
T Add ticker to a tag list
U Untag ticker from tag list
O Overlay feature
P Print active chart
L Toggle Log Scales on or off
V Set tag list
Z Toggle Zoom feature on or off (temporarily hide current indicators)
Function keys
F1 Help
F5 Close all open charts
F10 Toggle Control Panel on or off
Ctrl+O Display Chart Ticker dialog box
Esc Display Chart Ticker dialog box
Enter Toggle between Indicator and Explore panels
Ctrl+M Display Market Charts
Ctrl+Enter Display Indicator Constants box
Ctrl+left/right arrow Quick search for Expert Ratings
Alt+N Display ticker Notes
? Display ER rules
+ Explore right
– Explore left
* Explore up
/ Explore down
Left/right arrows Move date one period
Up/down arrows Select indicators or scroll through a list
Mar 30, 2016 | group sector rotation, Reports, swing trading, trading strategies
In your WinWay TradingExpert or TradingExpert Pro package, look for the icon for Reports and open it. The Market Log is toward the bottom of the list on the left.
Trading and investing becomes clearer when you’re armed with this snapshot of the market and SP 500 stocks every day.
– AI rating on the market and how long it has been in place
– AI rating on all Sp 500 stocks percentage showing up ratings vs down ratings
– Bullish vs bearish levels on the market on multiple techncial indicators
– Bullish vs bearish percentage of SP 500 groups trending up vs down and the change from prior day
– Bullish vs bearish levels summary for all the SP 500 stocks on multiple indicators

Mar 29, 2016 | EDS code, Expert Design Studio, indicators
Here is some code for use in AIQ based on Markos Katsanos’s article in this issue, “Trading The Loonie.” The code and EDS file can be downloaded from www.TradersEdgeSystems.com/traderstips.htm.
The code I am providing contains both the divergence indicator and a long-only trading system for the NASDAQ 100 list of stocks. Along with fx trading online, I wanted to try the divergence idea and the author’s entry rules on the NASDAQ 100 stocks. The stocks are traded long using the author’s entry rules with two of the parameters adjusted as shown at the top of the code file. The exit has been changed completely to use a profit protect (protect 50% of profits once a 20% profit is reached), a stop-loss (protect 75% of capital), and a time-stop exit (exit after 21 days). I used the NASDAQ 100 index (NDX) in place of the crude oil futures. The assumption is that since the stocks on the list are all in the NDX, they would generally be correlated to the index. The author’s entry rule filters out those with a negative correlation to the index. Note that I changed the minimum correlation from a -0.4 to 0.0. In addition, I found that increasing the minimum divergence from 20 to 2,000 increased the Sharpe ratio and decreased the maximum drawdown without affecting the annualized return.
Figure 6 shows the equity curve versus the NASDAQ 100 index for the period 1/5/2000 to 10/14/2015. Figure 7 shows the metrics for this same test period. The system clearly outperformed the index.

FIGURE 6: AIQ. Here is a sample equity curve for the modified divergence system versus the NASDAQ 100 index for the period 1/5/2000 to 10/14/2015.

FIGURE 7: AIQ. Here are the metrics for the modified system and the test settings.
!TRADING THE LOONIE
!Author: Markos Katsanos, TASC December 2015
!coded by: Richard Denning 10/17/15
!www.TradersEdgeSystems.com
!Set parameters:
Define Len 20. !Default is 20
Define F1 2. !Default is 2
Define F2 4. !Default is 4
IDX is "NDX". !NASDAQ 100 index
IDXsLen is 40. !Default is 40
minDIVERG is 2000. !Default is 20
minROC is 0. !Default is 0
minCorrel is 0.0. !Default is -0.4
!Close percent relative to BB band width for stock:
Variance is Variance([close],Len).
StdDev is Sqrt(Variance).
SMA is simpleavg([close],Len).
stkBB is 1+([close]-SMA+F1*StdDev)/(F2*StdDev).
!Close percent relative to BB band width for index:
IDXc is tickerUDF(IDX,[close]).
VarianceIdx is Variance(IDXc,Len).
StdDevIDX is Sqrt(Variance).
SMAidx is simpleavg(IDXc,Len).
idxBB is 1+(IDXc-SMAidx+F1*StdDevIDX)/(F2*StdDevIDX).
DIVERG is (idxBB-stkBB)/stkBB*100. !PLOT AS CUSTOM INDICATOR
DIVERG1 is valresult(DIVERG,1).
ROC2 is ([close]/val([close],2)-1)*100.
ROC3 is ([close]/val([close],3)-1)*100.
ROC3idx is tickerUDF(IDX,ROC3).
IDXsma is simpleavg(IDXc,IDXsLen).
IDXsma2 is valresult(IDXsma,2).
HHVdiverg is highresult(DIVERG,3).
Setup1 if highresult(DIVERG,3) > minDIVERG.
Setup2 if DIVERG < valresult(DIVERG,1).
Setup3 if ([close]/val([close],2)-1)*100 > minROC.
Setup4 if IDXsma > valresult(IDXsma,2).
Setup5 if pCorrel > minCorrel.
Buy if Setup1 and
Setup2 and
Setup3 and
Setup4 and
Setup5.
BuyAlt if Buy.
LongExit1 if MACD<sigMACD and valrule(MACD>sigMACD,1) and
Stoch > 85.
LongExit2 if lowresult(DIVERG,3)<-20 and ROC3idx<-0.4.
LongExit3 if [close]<loval([close],15,1) and pCorrel<minCorrel.
LongExit if LongExit1 or LongExit2 or LongExit3.
AlterLongExit if {position days} >=21 or [close] <= (1-0.25)*{position entry price}.
!Code to Calculate Pearson's R [for entry]:
! PeriodtoTest is the number of lookback days.
! IndexTkr is the Instrument that you which to compare your list to.
PeriodToTest is Len.
IndexTkr is IDX.
ChgTkr is ([open] / val([open],PeriodToTest)-1)*100.
ChgIdx is TickerUDF(IndexTkr,ChgTkr).
Alpha is ChgTkr - ChgIdx.
ValUDF is (([close]-[open])/[open]) * 100.
ValIndex is TickerUDF(IndexTkr, ValUDF).
ValTkr is ValUDF.
SumXSquared is Sum(Power(ValIndex,2), PeriodToTest).
SumX is Sum(ValIndex, PeriodToTest).
SumYSquared is Sum(Power(ValTkr,2), PeriodToTest).
SumY is Sum(ValTkr, PeriodToTest).
SumXY is Sum(ValTkr*ValIndex, PeriodToTest).
SP is SumXY - ( (SumX * SumY) / PeriodToTest ).
SSx is SumXSquared - ( (SumX * SumX) / PeriodToTest ).
SSy is SumYSquared - ( (SumY * SumY) / PeriodToTest ).
!Pearson's R and Pearson's Coefficient of Determination:
pCorrel is SP/SQRT(SSX*SSY).
!Code to Calculate Pearson's R [for exit]:
! PeriodtoTest is the number of lookback days.
! IndexTkr is the Instrument that you which to compare your list to.
PeriodToTestX is 3*Len.
IndexTkrX is IDX.
ChgTkrX is ([open] / val([open],PeriodToTestX)-1)*100.
ChgIdxX is TickerUDF(IndexTkrX,ChgTkrX).
AlphaX is ChgTkrX - ChgIdxX.
ValUDFX is (([close]-[open])/[open]) * 100.
ValIndexX is TickerUDF(IndexTkrX, ValUDFX).
ValTkrX is ValUDFX.
SumXSquaredX is Sum(Power(ValIndexX,2), PeriodToTestX).
SumXX is Sum(ValIndexX, PeriodToTestX).
SumYSquaredX is Sum(Power(ValTkrX,2), PeriodToTestX).
SumYX is Sum(ValTkrX, PeriodToTestX).
SumXYX is Sum(ValTkrX*ValIndexX, PeriodToTestX).
SPX is SumXYX - ( (SumXX * SumYX) / PeriodToTestX).
SSxX is SumXSquaredX - ( (SumXX * SumXX) / PeriodToTestX ).
SSyX is SumYSquaredX - ( (SumYX * SumYX) / PeriodToTestX ).
!Pearson's R and Pearson's Coefficient of Determination:
pCorrelX is SPX/SQRT(SSXX*SSYX).
!MACD code:
S is 12.
L is 25.
X is 9.
ShortMACDMA is expavg([Close],S).
LongMACDMA is expavg([Close],L).
MACD is ShortMACDMA-LongMACDMA.
SigMACD is expavg(MACD,X).
!Stochastic
StochLen is 30.
Stoch is 100 * (([Close]-LoVal([Low],StochLen)) /
(HiVal([High],StochLen) - LoVal([Low],StochLen))).
List if 1.
—Richard Denning
info@TradersEdgeSystems.com