StockFetcher Forums · Filter Exchange · HULL MA 10/50 CROSS, PSAR, vortex, ad nauseum<< >>Post Follow-up
graftonian
1,089 posts
msg #155430
Ignore graftonian
modified
1/25/2021 9:57:53 AM

The next change will be, combine column 6 and column 7 into 1 variable (msg #155415).

Fetcher[
/*Jan 25, 2021 version*/
/*Hull MA cross/ Schaff Trend Cycle/ Volume increase, PSAR, vortex*/
/*****************************Basic Criteria*********************/
chart-time is 12 months
not OTCBB
average volume(10) greater than 1234567
close between .50 and 50
close greater than close 1 day ago
open < 1.2 * close 1 day ago
Low > H100
sort on column 11 descending /* trigger */
/*****************************HULL50MA***********************/
set{slow1, cwma(close, 25)}
set{slow2, 2 * slow1}
set{slow3, cwma(close, 50)}
set{valslow, slow2 - slow3}
set{H50, cwma(valslow, 7)}
draw H50 on plot price
/******************************HULL10MA**********************/
set{slow1A, cwma(close, 5)}
set{slow2A, 2 * slow1A}
set{slow3A, cwma(close, 10)}
set{valslowA, slow2A - slow3A}
set{H10, cwma(valslowA, 3)}
DRAW H10 ON PLOT PRICE
/*****************************HULL100MA***********************/
set{slow1B, cwma(close, 50)}
set{slow2B, 2 * slow1B}
set{slow3B, cwma(close, 100)}
set{valslowB, slow2B - slow3B}
set{H100, cwma(valslowB, 10)}
draw H100 on plot price
/*********************SCHAFF TREND CYCLE**********************/
set{range, MACD (23,50,9) 10 day high - MACD (23,50,9) 10 day low}
set{var2, MACD (23,50,9) - MACD (23,50,9) 10 day low}
set{var3, var2 / range}
set{var6, cema(var3, 3) 10 day high}
set{var5, cema(var3, 3) 10 day low}
set{var7, cema(var3, 3) - var5}
set{var8, var6 - var5}
set{var9, var7 / var8}
set{var10, cema(var9, 3)}
set{STC, 100 * var10}
draw STC
draw STC line at 25
draw STC line at 75
/******************Volume % above 21 day average**************/
set{VolX, volume / CWMA(volume, 21)}
draw CWMA(volume, 21)
draw VolX
draw VolX line at 1
add column separator
/**********HullCrossOver-the first time****************/
set{HullCrossOver, count(H10 crossed above H50, 2)} /*raised to 2 for test*/
draw HullCrossOver
add column Hullcrossover
/*********HullMA cross count***********************************/
set{HullCrossCount, count(H10 > H50, 1)}
draw HullCrossCount
add column hullcrosscount{H10 over H50}
/***************STC crossed 25 count***************************/
set{STCcrosscount, count(STC > 25, 1)}
draw STCcrosscount
add column STCcrosscount{STC cross}
/****************************Volume % count********************/
set{VolCount, count(VolX 1 day ago > 1.05, 1)}
add column VolCount{volume up}

/************* 9 period Vortex Trend Indicator ****************/
set{plus_vm, abs(high minus low 1 day ago)}
set{minus_vm, abs(low minus high 1 day ago)}
set{plus_vm9, sum(plus_vm, 9)}
set{minus_vm9, sum(minus_vm, 9)}
set{atr1, average true range(1)}
set{tr9, sum(atr1, 9)}
set{vortex_bull, plus_vm9 / tr9}
set{vortex_bear, minus_vm9 / tr9}
draw vortex_bull
draw vortex_bear on plot vortex_bull
set{VortexPositive, count(vortex_bull > vortex_bear, 1)}
/***************************PSAR*******************************/
draw Parabolic SAR(0.02,0.2)
set{AbvPSAR, count(close > Parabolic SAR(0.02,0.2), 1)}
add column AbvPSAR
/************Sum the count calculations (trigger)**************/
set{trig1, HullCrossOver + HullCrossCount}
set{trig2, trig1 + STCcrosscount}
set{trig3, trig2 + VolCount}
set{trig4, trig3 + VortexPositive}
set{trigger, trig4 + AbvPSAR}
add column trigger
/****************21 DAY RATE OF RETURN*************************/
set{21ROR1, close - close 21 days ago}
set{21ROR2, 21ROR1 / close 21 days ago}
set{21ROR, 21ROR2 * 100}
draw 21ROR and add column 21ROR{21ROR%}
draw 21ROR line at 0*/
/* PSAR based position sizing */
set{AcctVal, 10000} /*Your stash here */
set{MaxLoss, AcctVal * .02} /* Your choice */
set{LossPerShare, close - Parabolic SAR(0.02,0.2)}
set{SharesToBuy1, MaxLoss / LossPerShare}
set{PositionSize, round(SharesToBuy1)}
add column separator
add column PositionSize
PositionSize > -1
set{EquityReqd, PositionSize * close}
add column EquityReqd
set{entry, close}
draw price line at entry
set{Bailout, Parabolic SAR(0.02,0.2)}
draw price line at bailout
]














fotchstecker
304 posts
msg #155443
Ignore fotchstecker
modified
1/25/2021 9:14:37 PM

Impressive filter, Graftonian. Thanks.
I wonder: is there a way to rank or additionally filter the tickers that come through. Is there a way to get down to, say, 10 max candidates per day? (other than the obvious, like price ranges or similar.)

graftonian
1,089 posts
msg #155448
Ignore graftonian
1/26/2021 10:32:15 AM

Fotch,
adding "TRIGGER > 4" would do it.
Graf

fotchstecker
304 posts
msg #155462
Ignore fotchstecker
modified
1/27/2021 9:11:39 AM

Graftonian, I'm working on converting this to a strategy. My first question to you was about reducing the number of candidates. My second: What are your thoughts about how to create stoploss levels?

I have two that I'm testing:
1. An "EMA Ribbon" where the position is scaled-out in stages if price crosses below the 10, 20, and 30 EMAs.
2. Using the lowest value among the 30, 20, and 10 ATRs (in percent) as the stoploss in percent from the entry. The idea being that there are already range expansions in play and that a downside move at least as big as the largest recent average range move should draw a line.

However, neither of these really have anything to do with the indicators you use. Given your construction of the filter, what are your thoughts regarding where to draw a stopline on positions generated in the filter? Curious to hear your thoughts. Thanks!

graftonian
1,089 posts
msg #155463
Ignore graftonian
1/27/2021 9:55:39 AM

fotch,
For stoploss, I use The higher of PSAR, or three significant period countback line.
Graf

fotchstecker
304 posts
msg #155465
Ignore fotchstecker
1/27/2021 12:05:02 PM

Thanks, graftonian. For PSAR, does that mean you will exit on a green-to-red change (as in the colors of the PSAR as charted)?

I didn't understand what you mean by "last 3 significant periods" -- could you explain?

graftonian
1,089 posts
msg #155469
Ignore graftonian
1/27/2021 4:00:07 PM

Fotch,
This vid. explains 3 day CBL better than I can.: https://www.youtube.com/watch?v=RYnKCALK5xM
I place a stop market order when executing a buy order, and raise my stop once or twice a day as warrented by CBL or PSAR. I pasted the following code to the end of my filters. I almost never buy the whole amount, as I am almost always limited by "cash on hand".
Graf

Fetcher[
/* PSAR based position sizing */
set{AcctVal, 10000} /*Your stash here */
set{MaxLoss, AcctVal * .02} /* Your choice */
set{LossPerShare, close - Parabolic SAR(0.02,0.2)}
set{SharesToBuy1, MaxLoss / LossPerShare}
set{PositionSize, round(SharesToBuy1)}
add column separator
add column PositionSize
PositionSize > -1
set{EquityReqd, PositionSize * close}
add column EquityReqd
set{entry, close}
draw price line at entry
set{Bailout, Parabolic SAR(0.02,0.2)}
draw price line at bailout
]





fotchstecker
304 posts
msg #155470
Ignore fotchstecker
1/27/2021 5:30:07 PM

Graftonian, this is very helpful. I appreciate it much! Thank you.

StockFetcher Forums · Filter Exchange · HULL MA 10/50 CROSS, PSAR, vortex, ad nauseum<< >>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.