StockFetcher Forums · Filter Exchange · PANGOLIN Z AND PANGOLIN W - FULL SYSTEM CODE<< 1 ... 5 6 7 8 9 >>Post Follow-up
Kevin_in_GA
4,599 posts
msg #135908
Ignore Kevin_in_GA
5/15/2017 7:50:09 AM

These were modified to use a dynamic profit target exit strategy, based on the reversersi(2,90) function. Not time or Z-score based any more. The stop loss is not adjusted. The trade is closed when either the profit target or the stop loss is hit.

DVMayfied
8 posts
msg #135921
Ignore DVMayfied
5/16/2017 1:57:51 AM

Is anyone actively trading w/ this filter? Curious to see how it's been going for people since the backtesting seems to be all thumbs up...

DVMayfied
8 posts
msg #136373
Ignore DVMayfied
6/14/2017 4:04:46 PM

I tried running a backtest of this in NinjaTrader and while the results were decent, they weren't phenomenal. Are people actively using this strategy or has it been dated? Seems like RSI(2) strats have been weakening over the last few years (from basic backtest results). What are people using to actively trade these days?

mahkoh
1,065 posts
msg #136390
Ignore mahkoh
6/15/2017 3:35:02 PM

I am currently revisiting this thread with a twist: http://www.stockfetcher.com/forums2/Filter-Exchange/HOW-TO-DESIGN-A-SYSTEM-NOT-JUST-A-FILTER/101013

I am using the filter against all stocks that have a correlation over 0.5 with SPY, which are some 1200 symbols. I then backtested the strategy using Stratasearch to find the best performing stocks and the best zsore settings over the last 2 years.

The best settings I found are entry at zscore -1.8 and exit at -0.7. Only zscore value, I disregard the bollinger band and Williams requirements. The stocks:

ADS
ERY
AAOI
CIT
MYGN
OMER
SUI
AXDX
KMT
UDR
ALLE
PODD
ROK
IVC
CHD
KSU
QSR
CCL
GXP
EA
DOV
CTLT
ARMK
RWT
DUK
ABC
MGM
ESS
PMT
BFAM
AME
NUVA
AVB
WYNN
FIS
WNC
MMM
Q
IVR
WLTW
MDLZ
BYD
NWS
DCT
RXN
VVC
ZTS
JCOM
SAFM
ES
CDW
ASGN
JNJ
BDN
HOLX
PDCO
POR
MMS
HUM
GPN
ABBV
ACGL
NWE
SSNC
DLPH
GMED
STMP
CSCO
ATR
PKI
HBHC
XPO
STAG
LAZ
RCL
ARE
AKBA
KEY
TMO
AWI
ANET
FTNT
IART
QRVO
LPX
XLF
AF
INOV
FIVE
LH
UGI
EPAM
PF
KTWO
PHM
IWM
SCHA
PFGC
IWO
EWW
HDB
AL
HLS
MA
FLIR
BAC
IBB
SCSS
RNG
PINC
CRM
EBAY
BRKR
NJR
BEAT
BGCP
RHT
ICLR
ARNC
STAR
TILE
QGEN
SIVB
ADI
JBLU
LL
RPXC
LEA
AYR
MDCO
REGN
FOE
KITE
CTRP
JKS
VECO
YY


DVMayfied
8 posts
msg #136392
Ignore DVMayfied
6/15/2017 7:30:12 PM

Very interesting, how has the backtest on this performed compared to the full system?

gmg733
788 posts
msg #136411
Ignore gmg733
6/16/2017 11:22:35 AM

@mahkoh

Can you post your SS code? Might be interesting to have a look at it.

Thnx

mahkoh
1,065 posts
msg #136413
Ignore mahkoh
modified
6/16/2017 2:53:16 PM

I determined the pool of stocks using Stockfetcher's correlation function, although there is a custom formula available for Stratasearch as well, may use that in a future run.
entry formula:
close > 6
and
mov(volume,200,s) > 200000
and zscore(100) > 1.8
and close > mov(close,200,s) * 0.5

exit
zscore(100) <1.8 - 1.1
or
$daysheld > 24

Where zscore is a custom formula Kevin created here: http://www.stratasearch.com/forum/viewtopic.php?f=3&t=950&p=4228&hilit=zscore#p4228

A few notes:
- the last entry statement was to check whether a close above ma(200) would improve results which it didn't.
- I ended up with a 100 day ratio lookback where the original filter used 16.
- I switched the ratio in the custom formula from stock/spy to spy/stock, hence I look for a zscore above a threshold instead of below.
- the exit line zscore < 1.8 - 1.1 essentially means 0.9. This is because the variables used in the formula.

The results against the pool of 1200: 44% average annual return for a pool of 20 stocks, 2168 trades from 10/20/2015 until 5/24/2017, 68 % profitable, profit factor 3.11.

I export all trades into excel and filtered the stocks that traded more than 3 times, were profitable at least 75 % and where average return on the trades was over 1%. I don't have statistics for this selection at hand, but I don't think this to be significant as it is obviously a very curve fitted result. I'm just picking those as they performed well in the past and would therefore expect them to act well in the future. Or at least have more trust in a stock that has performed well than one that did not.

I have paper traded the strategy since 5/10:
10 closed trades with an average return of 3.91 %, all profitable
6 open trades with an average return of 0.34 %, 4 currently in profit.

Hope that helps.



mahkoh
1,065 posts
msg #136414
Ignore mahkoh
6/16/2017 3:13:44 PM

And Stockfetcher code

Fetcher[
watchlist(zscore)

/*FIRST DETERMINE HISTORICAL RATIO OF S&P STOCK TO THE SPY OVER THE LAST 16 DAYS*/
SET{PRICERATIO, IND(SPY,CLOSE) / CLOSE}
SET{RATIOMA16, CMA(PRICERATIO,100)}
SET{RATIOSTD16, CSTDDEV(PRICERATIO,100)}
SET{DIFF16, PRICERATIO - RATIOMA16}
SET{ZSCORE16, DIFF16 / RATIOSTD16}
SET{THRESHOLD16, RATIOSTD16 * 2}

/*NEXT, SET CRITERIA NECESSARY TO TRIGGER A PAIR TRADE*/

SET{UPPERBAND16, RATIOMA16 + THRESHOLD16}
SET{LOWERBAND16, RATIOMA16 - THRESHOLD16}

ZSCORE16 above 1.8


DRAW LOWERBAND16 ON PLOT PRICERATIO
DRAW UPPERBAND16 ON PLOT PRICERATIO
DRAW BOLLINGER BANDS(16,2)
ADD COLUMN ZSCORE16 {Z-score}
ADD COLUMN WILLIAMS %R(16)

DRAW ZSCORE16 LINE AT 1.8
DRAW ZSCORE16 LINE AT 0.7


SORT ON COLUMN 5 ASCENDING
CHART-TIME IS 6 MONTHS
]



ron22
255 posts
msg #137609
Ignore ron22
8/13/2017 10:04:59 PM

@mahkoh, As of 8/11 there are 21 results for your watchlist(Zscore) filter. How do you determine which stocks to buy? Just start with the top stock listed and work your way down the list?

mahkoh
1,065 posts
msg #137633
Ignore mahkoh
8/14/2017 2:43:21 PM

This is a work in progress although I have been trading this live since half way June. I have opened 35 positions so far, starting with $2500 per position, adding/subtracting all running profits/losses into the next. If I open a new position it will be $4300, so the returns are as expected.
Of 25 closed trades 21 returned a profit, 3 a small loss and 1 a medium loss of $100. 10 positions are open, 5 are in profit. Among the other 5 are PDCO, which is turning into a $400 loss and ADS, under water $200 but this one has some time left.
I have closed positions when earnings came up and have skipped entries for the same reason.

I have found a few issues though: As you mentioned the filter returned 21 stocks, but a lot of those were in trade already. This is because I accidentally used "zscore16 above 1.8" instead of "crossed above 1.8"
The backtest however was also done using this statement and changing it to "crossed above" did anything but enhance results. Quite a few trades reentered immediately after the forced exit after 25 days to regain the losses from the first trade. The test was done using a 20 stock portfolio but should also work for 10 or 5. I just picked the largest number for evaluation in order to use the most significant sample.

On top of that I have been meaning to explore additional exit criteria as I found that most trades could have exited at a better price. As I said, work in progress.



StockFetcher Forums · Filter Exchange · PANGOLIN Z AND PANGOLIN W - FULL SYSTEM CODE<< 1 ... 5 6 7 8 9 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.