Category Archives: EDS

A Technical Method For Rating Stocks

The AIQ code based on Markos Katsanos’ article in this issue, “A Technical Method For Rating Stocks,” is shown below.
Synopsis from Stocks & Commodities June 2018
I’s it possible to create a stock rating system using multiple indicators or other technical criteria? If so, how does it compare with analyst ratings? Investors around the world move billions of dollars every day on advice from Wall Street research analysts. Most retail investors do not have the time or can’t be bothered to read the full stock report and rely solely on the bottom line: the stock rating. They believe these ratings are reliable and base their investment decisions at least partly on the analyst buy/sell rating. But how reliable are those buy/sell ratings? In this article I will present a technical stock rating system based on five technical criteria and indicators, backtest it, and compare its performance to analyst ratings.
!A TECHNICAL METHOD FOR RATING STOCKS
!Author: Markos Katsanos, TASC June 2018
!Coded by: Richard Denning, 4/18/18
!www.TradersEdgeSystems.com

!INPUTS:
  MAP is 63. 
  STIFFMAX is 7. 
  VFIPeriod is 130. 
  MASPY is 100. 
  MADL is 100.
  SCORECRIT is 5.
  W1 is 1.
  W2 is 1.
  W3 is 1.
  W4 is 1.
  W5 is 2.
 
!VFI FORMULA: 
  COEF is 0.2.
  VCOEF is 2.5.
  Avg is ([high]+[low]+[close])/3.
  inter is ln( Avg ) - ln( Valresult( Avg, 1 ) ). 
  vinter is sqrt(variance(inter, 30 )).
  cutoff is Coef * Vinter * [Close].
  vave is Valresult(simpleavg([volume], VFIPeriod ), 1 ).
  vmax is Vave * Vcoef.
  vc is Min( [volume], VMax ).
  mf is Avg - Valresult( Avg, 1 ).
  vcp is iff(MF > Cutoff,VC,iff(MF < -Cutoff,-VC,0)).
  vfitemp is Sum(VCP , VFIPeriod ) / Vave.
  vfi is expavg(VFItemp, 3 ).

!STIFFNESS 
  ma100 is Avg. 
  CLMA if [close] < MA100.
  STIFFNESS is countof(CLMA,MAP).

!CONDITIONS:
 ! MONEY FLOW:
   COND1 is iff(VFI>0,1,0). 
 !SIMPLEAVG:
    SMA is simpleavg([close],MADL).                              
    COND2 is iff([close]>SMA,1,0).  
 !SIMPLEAVG DIRECTION:                       
    COND3 is iff(SMA>valresult(SMA,4),1,0).  
!STIFFNESS:                          
    COND4 is iff(STIFFNESS<= STIFFMAX,1,0).  
!MARKET DIRECTION:
    SPY is TickerUDF("SPY",[close]).
    COND5 is iff(EXPAVG(SPY,MASPY)>= 
 valresult(EXPAVG(SPY,MASPY),2),1,0).            

SCORE is  W1*COND1+W2*COND2+W3*COND3+
   W4*COND4+W5*COND5.

 buy if Score>=SCORECRIT and hasdatafor(300)>=268. 
Figure 11 shows the summary results of a backtest using NASDAQ 100 stocks during a generally bullish period from April 2009 to April 2018. Figure 12 shows the backtest using the same list of NASDAQ 100 stocks during a period that had two bear markets (April 1999 to April 2009). The average results are similar except that there are fewer trades during the period that contained the two bear markets. Both backtests use a fixed 21-bar exit.
Sample Chart

FIGURE 11: AIQ, BULL MARKET. Here are the summary results of a backtest using NASDAQ 100 stocks during a generally bullish period from April 2009 to April 2018.
Sample Chart

FIGURE 12: AIQ, BEAR MARKET. Here are the summary results of a backtest using NASDAQ 100 stocks during a period from April 1999 to April 2009 that contained two bear markets.
—Richard Denning info@TradersEdgeSystems.com for AIQ Systems

Weekly & Daily Percentage Price Oscillator

The AIQ code based on Vitali Apirine’s article in Stocks & Commodities issue, “Weekly & Daily Percentage Price Oscillator,”  Modifying a traditional indicator can make you look at a chart differently. You can compare indexes, look at price movements during extended periods of time, and make trading decisions based on your observations is provided here:

!WEEKLY & DAILY PPO
!Author: Vitali Apirine, TASC Feb 2018
!Coded by: Richard Denning 12/17/17
!www.TradersEdgeSystems.com

!INPUTS:
S is 12.
L is 26.

EMA1 is expavg([Close],S).
EMA2 is expavg([Close],L).
EMA3 is expavg([Close],S*5).
EMA4 is expavg([Close],L*5).
DM is (EMA1 - EMA2)/EMA4*100.
WM is (EMA3 - EMA4)/EMA4*100.
WD_PPO is WM + DM.
Figure below shows the daily and weekly PPO indicator on a chart of the Nasdaq 100 index (NDX) from 2015 to 2017.

 

Sample Chart

 Here, the daily & weekly PPO is displayed on a chart of the NDX.

 

 

—Richard Denning info@TradersEdgeSystems.com for AIQ Systems

	

Prepare to Bounce

2018 sure was a great year for the stock market.  For almost a month anyway.  Since then, not so much.  And on the heels of last week’s selloff a lot of pundits and prognosticators are suggesting more loudly that the Great Bull Run is dead. And maybe they are right.  But maybe not.

It is almost always a mistake to hang your hat on one indicator to guide your actions going forward.  But at the same time, sometimes one indicator generates a signal so clear it perhaps should grab your attention.  Let’s look at one that is on the verge of sending an important signal.

The VixRSIRatio Indicator

This is an indicator that I developed a number of years ago by basically – I am going to use some highly technical terms here to describe the process I followed so please try to stay with me – mashing together several other indicators from other people.  If you are interested in the actual calculations they appear at the end of the article.  For now, just know that I refer to it as VixRSIRatio.  As I follow it, it gives meaningful signals very infrequently.  But that is OK as the signals it does give often prove to be useful.

For our purposes we will apply it to ticker SPY – an ETF that tracks the S&amp;P 500 Index. The rule is simple:

*A “Bullish Alert” occurs when VixRSIRatio drops to -210 or below and then turns up.

That’s it. Now please note the use of the phrase “Bullish Alert” and the lack of the words “You”, “Can’t” and “Lose”, as well as the lack of the phrase “by putting all of your money in the market at the exact moment a signal occurs.”

This is key.  Also note that there is nothing “magic” about the value -210. Nothing scientific about it. It just seems like a useful cutoff.  Now let’s look at the “Bullish Alert” signals in recent years.  They appear in Figures 1 through 4.

1

Figure 1 – Jay’s VixRSIRatio; 2014-2018 (Courtesy AIQ TradingExpert)

2

Figure 2 – Jay’s VixRSIRatio; 2010-2013(Courtesy AIQ TradingExpert)

3

Figure 3 – Jay’s VixRSIRatio; 2006-2009 (Courtesy AIQ TradingExpert)

4

Figure 4 – Jay’s VixRSIRatio; 2001-2005 (Courtesy AIQ TradingExpert)

As you can see in Figures 1 through 4:

a) Readings below -210 tend to be followed by – at the least – decent trading opportunities.

b) Often these readings presage significant market advances

c) And alas, sometimes the signals come too soon and/or are not followed by much of an advance.

The Here and Now

As of 3/23/18 the VixRSIRatio for ticker SPY stood -354.  So clearly “Buy Alert” is at hand.  So the obvious question is “What comes next”?  Will it be a, b, or c above?

As always, time will tell.

Calculations

In a nutshell, VixRSIRatio combines Larry Williams’ Vixfix indicator with Welles Wilder’s 3-day and 14-day RSI indicators to create two more indicators – VixRSI3 and VixRSI14.  We then divide VixRSI3 by VixRSI14 and invert the whole thing (so that we get an indicator that gives negative readings when the market goes down).

Now you see why I put this at the end….

Below is the code for AIQ Expert Design Studio

############## Larry Williams Vixfix #################

xx is 15.

hivalclose is hival([close],22).

vixfix is (((hivalclose-[low])/hivalclose)*100)+50.

############ Welles Wilder RSI 3-day ##############

Define days3 5.

U3 is [close]-val([close],1).

D3 is val([close],1)-[close].

AvgU3 is ExpAvg(iff(U3&gt;0,U3,0),days3).

AvgD3 is ExpAvg(iff(D3&gt;=0,D3,0),days3).

RSI3 is 100-(100/(1+(AvgU3/AvgD3))).

############ Welles Wilder RSI 14-day ##############

Define days14 27.

U14 is [close]-val([close],1).

D14 is val([close],1)-[close].

AvgU14 is ExpAvg(iff(U14&gt;0,U14,0),days14).

AvgD14 is ExpAvg(iff(D14&gt;=0,D14,0),days14).

RSI14 is 100-(100/(1+(AvgU14/AvgD14))).

############Jay’s VixRSIRatio ##############

VixRSI3 is expavg(vixfix,3)/expavg(RSI3,3).

VixRSI14 is expavg(vixfix,3)/expavg(RSI14,3).

VixRSIRatio is -((((VixRSI3/VixRSI14)-1)*100)-50).

Jay Kaeppel

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.

Biotech + Gold (Updated)

In this article I wrote about an index I follow that combines the biotech sector with the gold stock sector. I also wrote about “one way” to trade that index.  This article builds on that piece and adds a new “rule” to create more trading opportunities.
The BIOGOLD Index
Figure 1 displays the index that I created using AIQ TradingExpert.  It combines ticker FBIOX (Fidelity Select Biotech) with ticker FSAGX (Fidelity Select Gold).
1
Figure 1 – Jay’s BIOGOLD Index (Courtesy AIQ TradingExpert)
Also included in the lower clip is an indicator referred to as RSI32, which is the 2-day average of the standard 3-day RSI.
The Old System
In the original article I tested an approach that works as follows using monthly data:
*When the RSI32 drops to 32 or below, buy BOTH FBIOX and FSAGX
*After a buy signal, sell both funds when RSI32 rises to 64 or higher
For results, please see the original article.
The New System
The “new rules” are as follows:
A “buy signal” occurs when either:
*The RSI32 drops to 32 or below
*The RSI32 drops below 50 (but not as low as 32) and then reverses to the upside for one month
After either of the buy signals above occurs, buy BOTH FBIOX and FSAGX
*After a buy signal, sell both funds when RSI32 rises to 64 or higher
Figure 2 displays the BIOGOLD Index with various buy and sell signals marked.
2
Figure 2 – Jay’s BIOGOLD Index with RSI32 signals (Courtesy AIQ TradingExpert)
To test results we will:
*Assume that after a buy signal both FBIOX and FSAGX are bought in equal amounts
*We will assume that both funds are held until RSI32 reaches 64 or higher (i.e., there is no stop-loss provision in this test)
For testing purposes we will not assume any interest earned while out of the market, in order to highlight only the performance during active buy signals. Figure 3 displays the hypothetical growth of $1,000 (using monthly total return data) using the “system”.
3
Figure 3 – Hypothetical Growth of $1,000 using Jay’s BIOGOLD System (1986-present)
Summary
For the record, I am not “recommending” that anyone go out and initiate trading biotech and gold based on what I have written here.  Before trading using any approach it is essential for a trader to do their own homework and carefully consider all of the pro’s and con’s associated with any specific approach.  For example, while the trade-by-trade results for the above look reasonably good, it should be noted that there have been 4 separate drawdown’s in excess of -19% along the way, including a maximum drawdown of -37% in 2008.  In considering any approach to trading it is essential to first think long and hard about how well one would “weather the storms”, BEFORE focusing on potential profitability.
To put it more succinctly is the simple phrase “Don’t cross the river if you can’t swim the tide.”
Jay Kaeppel
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.

The VixRSI14 Indicator – Part 2

In this article I detailed an indicator I refer to as VixRSI14 using monthly charts. Today let’s apply the same method to weekly bar charts.  Before we do that a quick look at how this indicator functions.
VixRSI combines two indicators – Larry William’s VixFix and Welles Wilder’s Relative Strength Index (RSI).  In Figure 1 you see a weekly bar chart for YHOO.  Notice that as price declines the VixFix indicator rises and RSI falls. VixRSI14 essentially measures the difference between the two and looks for extremes as a sign of a potential reversal. See Figure 5 for YHOO with VixRSI14.
0
Figure 1 – YHOO with Williams VixFix (with 3-day exponential smoothing) and Wilder’s 14-period RSI (Courtesy AIQ TradingExpert)
The Weekly Version of VixRSI14
We will use the same method I described in the previous article, i.e.:
*We will calculate the VixRSI14 indicator (see code at end of article) on a weekly basis
*A “buy alert” occurs when VixRSI14 drops below 3.00 after first rising to 3.50 or higher
Once again, please note that:
*There is nothing magic about 3.50 or 3.00
*Not every “buy alert” is followed by an immediate rally (or even any rally at all for that matter)
*Any actually trading”results” will depend heavily on what you trade, how much of it you trade, when you actually get in, when you get out with a profit and/or when you get out with a loss.
*This VixRSI14 alert signal is simply serving notice that a given security may be overdone on the downside and may be ready soon to reverse to the upside.  Nothing more, nothing less.1
Figure 2 – AAPL(Courtesy AIQ TradingExpert)
2
Figure 3 – AXP (Courtesy AIQ TradingExpert)
3
Figure 4 – IP (Courtesy AIQ TradingExpert)
4
Figure 5 – YHOO (Courtesy AIQ TradingExpert)
Summary
In 2018 I intend to try to share a few more trading “ideas” that maybe are not quite “finished products”.  VixRSI14 fits neatly into the “Idea” category. Sometimes the alerts are early.  Sometimes the alerts are late.  Sometime the alerts don’t really pan out at all.  Sometimes alerts are followed by one more sharp decline which is then followed by a major rally. So maybe some sort of trend reversal confirmation would be helpful.  I don’t know.
Hey, that gives me an idea….
Code:
William’s VixFix is simply the 22-period high price minus today’s low price divided by the 22-day period price (I then multiply by 100 and then add 50).  That may sound complicated but it is not.
The code for AIQ TradingExpert appears below.
########## VixFix Code #############
hivalclose is hival([close],22).
vixfix is (((hivalclose-[low])/hivalclose)*100)+50.
###############################
####### 14-period RSI Code ###########
Define periods14 27.
U14 is [close]-val([close],1).
D14 is val([close],1)-[close].
AvgU14 is ExpAvg(iff(U14>0,U14,0),periods14).
AvgD14 is ExpAvg(iff(D14>=0,D14,0),periods14).
RSI14 is 100-(100/(1+(AvgU14/AvgD14))).
###############################
VixRSI14 is then calculated by dividing the 3-period exponential average of VixFix by the 3-period exponential average of RSI14
####### VixRSI14 Code ###########
VixRSI14 is expavg(vixfix,3)/expavg(RSI14,3).
###############################
Jay Kaeppel
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.

The VixRSI14 Indicator – Part 1

While the bulk of the financial world focuses most of its attention on whether or not Bitcoin will turn to sh, er, something that rhymes with Bitcoin, a lot of “old timers” continue on with trying to look at markets in a more traditional way. Unfortunately, some people who try to look at markets in a more traditional way also spend an inordinate amount of time “dividing one number by another” thinking there is some purpose to it (“Hi. My name is Jay”)

The only good news is that every once in awhile something useful – or at least potentially useful (since no single calculation guarantees profitability which also involves other “minor” issues such as which securities to trade, allocation size, entry method, profit taking criteria, stop loss triggers and so on and so forth). A number of years ago I stumbled upon a calculation that I ultimately refer to as VixRSI (for reasons that will become fairly obvious soon).  More specifically I have a few different versions but one I like is call used VixRSI14.

First the Good News: In this and some future articles I will detail how I apply VixRSI14 to monthly, weekly and daily price charts.

Now the Bad News: Nothing that I will write in any of those articles will detail a “simple automated system that generates you can’t lose trading signals guaranteed to make you rich beyond the dreams of avarice.”  Sorry about that. But I thought you should know.

The truth is that the indicator generates signals – and yes, a certain percentage of the time those signals aren’t that great.  And even on occasions when the signals are decent all of the factors I mentioned above (securities traded, capital allocation, etc.) still hold the key to turning a “signal” into a “profit”.

VixRSI14

VixRSI14 is calculated by combining Larry William’s “VixFix” indicator with the standard old 14-day RSI from Welles Wilder. I’ve decided to put the calculations at the end of the article in order to avoid scaring anyone off.

For now let’s look at what to look for on a monthly price chart.

VixRSI14 on a Monthly Chart

OK, true confession time: there is (at least as far as I can tell) no “one best way” to use VixRSI14 on a monthly chart.  So I will simply show you “One way.”

*A “buy alert” is triggered when the monthly value for VixRSI14 first rises to 3.5 or higher and then drops back to 3.0 or below

*Before going on please note that there is nothing “magic” about 3.5 or 3.  Different values can be used and will generate varying results.

*Also, some may prefer to simply look for a drop from above 3 to below 3 without requiring a move above 3.5

*Finally please note the use of the phrase “buy alert” and the lack of the phrase “BUY AS MUCH AS YOU CAN RIGHT THIS VERY MINUTE!!!!”

Figures 1 through 4 show several different Dow30 stocks “through the years.

1

Figure 1 – Ticker AXP (Courtesy AIQ TradingExpert)

2

Figure 2 – Ticker BA (Courtesy AIQ TradingExpert)

3

Figure 3 – Ticker HPQ (Courtesy AIQ TradingExpert)

4

Figure 4 – Ticker IBM (Courtesy AIQ TradingExpert)

Summary

Buy alerts on monthly charts using the criteria I described are obviously very rare.  In fact many securities never see the VixRSI14 rise high enough to trigger an alert.  Likewise, not every 3.5 then 3 event for every stock will work out as well as those depicted in Figures 1 through 4.

Still, remember that I am just presenting an “idea” and not a finished product.

Code:

William’s VixFix is simply the 22-day high price minus today’s low price divided by the 22-day high price (I then multiply by 100 and then add 50).  That may sound complicated but it is not.

The code for AIQ TradingExpert appears below.

########## VixFix Code #############

hivalclose is hival([close],22).

vixfix is (((hivalclose-[low])/hivalclose)*100)+50.

###############################

####### 14-period RSI Code ###########

Define periods14 27.

U14 is [close]-val([close],1).

D14 is val([close],1)-[close].

AvgU14 is ExpAvg(iff(U14&gt;0,U14,0),periods14).

AvgD14 is ExpAvg(iff(D14&gt;=0,D14,0),periods14).

RSI14 is 100-(100/(1+(AvgU14/AvgD14))).

###############################

VixRSI14 is then calculated by dividing the 3-period exponential average of VixFix by the 3-period exponential average of RSI14

####### VixRSI14 Code ###########

VixRSI14 is expavg(vixfix,3)/expavg(RSI14,3).

###############################

Jay Kaeppel

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.

Trend or Countertrend? Why Not Both?

First the brutal disclaimers: What follows is NOT a trading “system.” It is merely an “idea.” Even more brutally, I can’t even claim that it “works”.  All the testing I have done so far is more anecdotal. Also to an extremely huge degree, the actual entry trigger and exit trigger that  trader might choose to use will have – as always – at least as much if not more impact on overall trading results as the actual “alert” signal detailed below.
Got that?  OK, then let’s proceed.
The Debate
The ongoing debate in trading is always – trend-following or countertrend?  Which is the way to go?  There are (conservatively) at least a bazillion and one ways to argue one way or the other.       Figure 1 displays ticker TXN with upper and lower “Acceleration Bands” (code for AIQ TradingExpert appears after disclaimer at end of article) drawn.
1
Figure 1 – Ticker TXN with Acceleration Bands (Courtesy AIQ TradingExpert)
Want to start a debate?  Ask this question: Is it better to buy when price hits the upper band or the lower band?  Sometimes price hits the upper band and just keeps going.  Sometimes it hits the upper band and the move peters out and reverses fairly quickly.
Going with the trend can lead to some big winning trades along the way, but typically involves a lot of whipsaws as well. Trading countertrend can lead to some great, quick profits – expect of course for when the initial trend never quite reverses and quick losses accrue instead.
What to do, what to do?
So the “idea” I mentioned at the outset generally goes like this:
*In an uptrend (which we will define in a moment)
*Wait for price to hit the Upper Band
*Then wait for a pullback
*Then wait for the uptrend to reassert itself
Got that? OK, me neither exactly.  So let’s try to define things a little more clearly.
1. As long as the closing price remains above the 200-day moving average, we will call that an “uptrend”
2. Within an uptrend wait for the high of a trading day to reach or exceed the Upper Acceleration Band.
3. Following #2, wait for the 4-day RSI to drop to 32 or lower with the following caveats:
*If price touches the Lower Acceleration Band OR closes below the 200-day moving average
*Then the setup is invalidated
This is the “Setup”.  For sake of example I will add an entry trigger as follows:
4. Following a valid #3 Alert Signal, buy when price exceeds the previous day’s high
I am going to purposely NOT add an exit trigger – just so that no one decides to “try it out” without at least giving it some thought on their own.
So Figure 2 shows the “Alerts” and “Entry Triggers” for the chart in Figure 1.
2Figure 2 – Ticker TXN with Example “Entry Triggers” (Courtesy AIQ TradingExpert)
So Figure 3 shows the “Alerts” and “Entry Triggers” for ticker EBAY3
Figure 3 – Ticker EBAY with Example “Entry Triggers” (Courtesy AIQ TradingExpert)
So Figure 4 shows the “Alerts” and “Entry Triggers” for ticker CSCO
4
Figure 4 – Ticker CSCO with Example “Entry Triggers” (Courtesy AIQ TradingExpert)
So are these signals any good? Well, like a lot of trading methods, some look pretty good and others do not.  As I also mentioned earlier, a lot depends on the method or methods you use to exit each trade.
Summary
The reality is that there is a chance that the “idea” contained herein is just no darn good.
But also remember that there are other “trend filters” (besides the 200-day moving average), there are other “bands” (besides Acceleration Bands”), there are other oversold indicators (besides 4-day RSI) and there are other entry and exit triggers.
As such, this piece is essentially for people who are willing to do a little digging on their own and, a) become comfortable (or not) with the idea, and b) develop  some position sizing, stop-loss and profit-taking criteria.
Jay Kaeppel
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.
Acceleration Bands Code for AIQ Expert Design Studio EDS
a is ([high]-[low]).
b is ([high]+[low])/2.
c is (a / b).
d is (c*2).
e is (1+d).
f is (1-d).
g is ([high]*e).
h is ([low]*f).
AccelUB is Simpleavg(g, 20).
AccelLB is Simpleavg(h, 20).

Weekly and Daily MACD

The AIQ code based on Vitali Apirine’s article in December 2017 issue of Stocks and Commodities magazine, “Weekly & Daily MACD,” is provided below.
The moving average convergence/divergence oscillator (MACD), developed by Gerald Appel, is one of the more popular technical analysis indicators. The MACD is typically used on a single timeframe, but what if we looked at two timeframes on one chart?

Traders can look for relative daily MACD line crossovers, weekly and daily centerline crossovers, and divergences to generate trading signals. 
Figure 5 shows the daily & weekly MACD indicator on a chart of Apple Inc. (AAPL) during 2016 and 2017, when there was a change from a downtrend to an uptrend.
Sample Chart

FIGURE 5: AIQ. Here is an example of the daily & weekly MACD on a chart of AAPL.
The code and EDS file can be downloaded from http://aiqsystems.com/dailyweeklyMACD.EDS, or copied here:
!WEEKLY & DAILY MACD
!Author: Vitali Apirine, TASC Dec 2017
!Coded by: Richard Denning 10/13/17
!www.TradersEdgeSystems.com

!INPUTS:
S is 12.
L is 25.

EMA1 is expavg([Close],S).
EMA2 is expavg([Close],L).
EMA3 is expavg([Close],S*5).
EMA4 is expavg([Close],L*5).
MACD is EMA1 - EMA2.
MACDW is EMA3 - EMA4.
rdMACD is MACD + MACDW.
—Richard Denning
info@TradersEdgeSystems.com
for AIQ Systems

A Candlestick Strategy With Soldiers And Crows

ndle reversal patterns—a bullish one white soldier and a bearish one black crow—that requ

The Expert Design Studio code for Jerry D’Ambrosio and Barbara Star’s article, “A Candlestick Strategy With Soldiers And Crows,” in Stocks & Commodities October 2018 issue is shown below.”Among the more well-known candlestick reversal patterns are soldiers and crows. These occur in a three-candle pattern such as three white soldiers or three black crows. Recently, on the website Candlesticker.com, we learned of two other candle reversal patterns—a bullish one white soldier and a bearish one black crow—that require fewer candles. ”

!A CANDLESTICK STRATEGY WITH SOLDIERS AND CROWS
!Author: Jerry D'Ambrosio & Barbara Star, TASC Oct 2017
!Coded by: Richard Denning 8/05/2017
!www.TradersEdgeSystems.com

!CODING ABBREVIATIONS:
O is [open].
O1 is valresult(O,1).
C is [close].
C1 is valresult(C,1).
C2 is valresult(C,2).
H is [high].
L is [low].
V is [volume].

!INPUTS:
minPriceBull is 1.
minPriceBear is 10.
minVolume is 1000. !in hundreds
volAvgLen is 50.
dayCount is 5.
longExitBars is 7.
shortExitBars is 1.

okToBuy if simpleavg(C,50) > simpleavg(C,200) or CminPriceBull and simpleavg(V,volAvgLen)>minVolume.
BullWS if C1C1 and C>O1 and O= longExitBars.

okToSell if simpleavg(C,50) < simpleavg(C,200) or C>simpleavg(C,200)*1.1.
okToSellMkt if TickerRule("SPX",okToSell).
PVfilterBear if C>minPriceBear and simpleavg(V,volAvgLen).
BearBC if C1>C2 and C1>O1 
     and OO1 
     and countof(C1>C2,dayCount)=dayCount
     and PVfilterBear and okToSellMkt.
ExitShort if {position days} >= shortExitBars.
I ran several backtests using the NASDAQ 100 list of stocks over the period from 8/04/2000 to 8/04/2017. I varied the following inputs to find the optimum set of parameters for the candlestick patterns. For longs, the “dayCount” = 5 with an “longExitBars” = 7 produced the best results, which is shown in Figure 5. For shorts, the “dayCount” = 5 with a “shortExitBars” = 1 produced the best results, which is shown in Figure 6. Neither commission nor slippage were subtracted from the results.

Sample Chart

FIGURE 5: WINWAY. EDS summary report for longs only.

Sample Chart

FIGURE 6: WINWAY. EDS summary report for shorts only.
—Richard Denning
info@TradersEdgeSystems.com
for TradingExpert Pro

ire fewer candles. “

System Development Using Artificial Intelligence

The AIQ code based on Domenico D’Errico and Giovanni Trombetta’s article in August 2017 Stock & Commodities issue, “System Development Using Artificial Intelligence,” is shown here. You can also download the EDS file from here

Are humans or computers better at trading? This question has been around on many fronts since the era of punch cards, and as technology advances, you question whether machines have limits. It’s the same with trading, and here’s an algorithm that may shed some light on which performs better…

!ARTIFICAL INTELLIGENCE FOR SYSTEM DEVELOPMENT
!Authors: Domenico D'Errico & Giovanni Trombetta, TASC August 2017
!Coded by: Richard Denning, 6/08/2017
!www.TradersEdgeSystems.com

!INPUTS:
O is [open].
C is [close].
H is [high].
L is [low].
exitBars is 8.
exitBarsP is 6.
enterGap is -0.08.

!CODE:
AvgP is (O+C+H+L)/4.
MedP is (H+L)/2.
MedB is (O+C)/2.

AvgP1 is valresult(AvgP,1).
AvgP2 is valresult(AvgP,2).
AvgP3 is valresult(AvgP,3).

MedP1 is valresult(MedP,1).
MedP2 is valresult(MedP,2).
MedP3 is valresult(MedP,3).
MedP4 is valresult(MedP,4).

MedB1 is valresult(MedB,1).
MedB2 is valresult(MedB,2).
MedB3 is valresult(MedB,3).
MedB4 is valresult(MedB,4).

!ENTRY & EXIT RULESl
Gandalf if 
  (AvgP1exitBars-1)
 or ({position days}>=exitBars-1)
 or ({position days}>=exitBarsP-1 and (C-{position entry price}>0)).

EntryPr is min(val([low],1) + enterGap,[open]).

Buy if Gandalf and [low] <= EntryPr.

See Figure 10 for how to set up the pricing in a backtest.
Sample Chart

FIGURE 10: AIQ. This shows the EDS backtest settings for entry pricing.
—Richard Denning
info@TradersEdgeSystems.com
for AIQ Systems