StockFetcher Forums · View by Author: mahkoh (1,059 messages) ·  [ Display By: Date / Subject ]<< 1 2 3 4 5 ... 106 >> 
Filter Exchange ·  use this symlist to pick off tops and bottoms of the spy or market
mahkoh
msg #111996
modified
3/1/2013 3:25:04 PM

Fetcher[
symlist(spy)

set{spy1,ind(spy,close)}
set{soxl1,ind(soxl,close)}
set{xiv1,ind(xiv,close)}
set{vxx1,ind(vxx,close)}
set{soxs1,ind(soxs,close)}

set{a,count(spy1 above spy1 1 day ago,1)}
set{b,count(soxs1 above soxs1 1 day ago,1)}
set{c,count(vxx1 above vxx1 1 day ago,1)}
set{d,count(xiv1 below xiv1 1 day ago,1)}
set{e,count(soxl1 below soxl1 1 day ago,1)}

set{a1,a + b}
set{a2,a1 + c}
set{a3,a2 + d}
set{a4,a3 + e}

draw a4
]



The situation occurs when the below indicator shows a value of 5

Filter Exchange · * * * close / open * * *
mahkoh
msg #99341
2/22/2011 4:37:19 PM

I believe placing a buy stop just above the previous day's high is a sensible entry point and have tried to code this into backtesting without success. I used " price above high 1 day ago ", any of you have a clue as to what the proper code would be?

Filter Exchange · * * rsi 1 and rsi 2 with sum * *
mahkoh
msg #98243
12/27/2010 4:23:09 PM

I'm a bit puzzled here.
" sum(rsi(1),2) equals 0 " - I believe this means that the value of the 1 day RSI + 2 = 0
Can RSI be negative?


Filter Exchange · * * rsi 1 and rsi 2 with sum * *
mahkoh
msg #98250
12/27/2010 7:43:07 PM

Thanks, four.
I had come across that help page before but could not really grasp the meaning as the attached example filter didn't make sense to me.
" sum(rsi(1),2) equals 0 " must mean "1 day RSI has been zero for the last two days"

Filter Exchange · * * Williams %R and RSI
mahkoh
msg #98111
12/19/2010 2:25:02 PM

This looks promising, thanks for sharing. A quick glance would suggest that W%R(2) crossing down -25 would be a point to look for an exit. Would you agree?

General Discussion · ...Why and Why not?
mahkoh
msg #137150
modified
7/30/2017 5:08:06 AM

Unless some here secretly are institutional fundmanagers I think the filter would need to include something like 'average volume(90) below 20000' to make a noticable impact on the market.

General Discussion · ...Why and Why not?
mahkoh
msg #137173
7/30/2017 6:23:46 PM

I shared a strategy that has consistently worked for me here:

http://www.stockfetcher.com/sfforums2/?mid=134736

All you need to do is go to the sharedlist page and check whether I updated "filter". If so, run the fetcher from the thread, choose your pick and sell an out of the money put 4 to 6 weeks out.

Filter Exchange · /* THE BIGGEST LOSERS - OVER NIGHT HOLD - LONG TRADE*/
mahkoh
msg #99886
modified
3/25/2011 5:48:35 PM

TRO I'm trying to get a grasp of this strategy. If I understand correctly you sell at the open if it gaps up and if it gaps down the odds are strongly in your favor that at some point during the day it will trade near your entry and you can exit at least at breakeven.
It might be an idea to have a column that tells you which of the candidates has the best record of gapping up since this is where you make your money. And another one, maybe even more important, in case the stock gaps down, at which point the odds are no longer in your favor that it will move back up to your entry point. This would be helpful in selecting the place for a stop-loss. The first column isn't that difficult, I could borrow that from your fading the gap filter, but the latter is a bigger challenge that goes beyond my coding skills. Do you think that can be done?
And if not, would you give us some insight on where you would want to place a stop-loss? (assuming you use one)

Filter Exchange · /* THE BIGGEST LOSERS - OVER NIGHT HOLD - LONG TRADE*/
mahkoh
msg #99920
modified
3/26/2011 6:23:32 PM

Maybe this modified fading the gap filter is indeed more suited to trade gaps overnight

Fetcher[
/* gap fill statistics */
CLOSE between 5 and 99
AVERAGE VOLUME(90) ABOVE 500000
CMA(absgap,30) above 1
absgap 30 day high below 30



set{Xgapped, open - close 1 day ago}
set{Xgapup, count(Xgapped > 0, 1)}
set{Xgapdn, count(Xgapped < 0, 1)}

set{absgapz, abs(Xgapped)}
set{absgapx,absgapz/close 1 day ago}
set{ absgap,absgapx*100}

set{gappedup100, count(Xgapup > 0, 100)}
set{gappeddn100, count(Xgapdn > 0, 100)}

set{cl1lo, close 1 day ago - low}
set{hicl1, high - close 1 day ago }

set{fillup, count(cl1lo > 0, 1)}
set{filldn, count(hicl1 > 0, 1)}

set{gapupfilled, Xgapup * fillup }
set{gapdnfilled, Xgapdn * filldn }

set{gapup100f, count(gapupfilled > 0, 100)}
set{gapdn100f, count(gapdnfilled > 0, 100)}

set{gapfilled, gapup100f + gapdn100f}

/* DRAW PLOTS */

DRAW XGAPPED ON PLOT XGAPPED

/* DISPLAY COLUMNS */

and add column gappedup100
and add column gapup100f
set {filluppct , gapup100f/gappedup100}
an add column filluppct

and add column gapfilled

and add column gappeddn100
and add column gapdn100f
set {filldnpct , gapdn100f/gappeddn100}
an add column filldnpct


and add column cma(absgap, 30)
and add column absgap 30 day high
and add column industry
/* SELECTION CRITERIA */


/* SORT CRITERIA */

SORT COLUMN 15 DESCENDING

set{gapratio , gappedup100/gappeddn100}
add column gapratio
]



The gapratio tells you how many times the stock gapped up for every gap down during the last 100 days. Filldnpct tells you your chances of getting out at breakeven in case it does gap down. If you want to be "market neutral" you can as well select a few with a low gapratio to short at the close. In that case Filluppcnt is the column to look at for your chances if it does gap up.

absgap- 6 weekhigh is also a column to watch, this is the highest gap during the last 30 days. A large gap up or down ofcourse will have an impact on your average gap column.

There's one thing I would like to adjust in this filter: The MA(absgap30) column shows the average gap in % during the last 30 days. This value however is the average value of gaps up and gaps down. I would like to have 2 seperate columns for the up and down gaps. If anyone has ideas on how to accomplish this I would appreciate it.








Filter Exchange · /* THE BIGGEST LOSERS - OVER NIGHT HOLD - LONG TRADE*/
mahkoh
msg #102858
modified
10/7/2011 5:13:21 PM

I have been busy with this filter recently. During my vacation I did not have constant internet and computer access and decided this would be a good time to test a strategy. My idea was to make a short and a long version of the filter and place market on close orders on 10 longs and 10 shorts. This should make me market neutral.

I set the filter so that it looks for an 80 % probabilty of a 0.9% profit over yesterday's close, scanning for stocks over 8$ as you may get some slippage with MOC orders. I choose to sort by OVERX because I want to put a bit more weight to recent data.

If statistics are correct I expect to get stuck with about 4 stocks (20 % of my position) every day that I will likely have to close out with a loss. The question is: Will my 16 daily winners cover for my 4 daily losses? Take into consideration that a 0.8% profit counts as a loser.

As I considered the possibility that I would occasionaly hold a losing position overnight I added TRO's trend indicator and a measurement of the 8 day slope of the 30 MA(q). I let this value weigh in deciding which stocks to play for the next day.

You will have stocks gapping against you (and hopefully stocks gapping in your desired direction as well). I added a "fading the gap" exerpt so that in case of a gap against me I could reset my target to breakeven and have 70 % probability of the gap being filled.

The long filter:

Fetcher[
/*OVERNIGHT LONG*/

close above 8
avg volume(90) above 300000
OVERX above 79
do not draw OVERX
filldnpct above 0.70
do not draw filldnpct

set{Long_Profit1, high - close 1 day ago}
set{Long_Profit2, Long_Profit1 / close 1 day ago}
set{Long_Profit, Long_Profit2 * 100}
draw cma (Long_Profit, 100)


/* ENTER THE PERCENTAGE YOU WANT TESTED */
set{OVERX, count(Long_Profit > 0.89 , 100)}


set{Xgapped, open - close 1 day ago}
set{Xgapup, count(Xgapped > 0, 1)}
set{Xgapdn, count(Xgapped < 0, 1)}

set{gappedup100, count(Xgapup > 0, 100)}
set{gappeddn100, count(Xgapdn > 0, 100)}

set{cl1lo, close 1 day ago - low}
set{hicl1, high - close 1 day ago }

set{fillup, count(cl1lo > 0, 1)}
set{filldn, count(hicl1 > 0, 1)}

set{gapupfilled, Xgapup * fillup }
set{gapdnfilled, Xgapdn * filldn }

set{gapup100f, count(gapupfilled > 0, 100)}
set{gapdn100f, count(gapdnfilled > 0, 100)}

set{gapfilled, gapup100f + gapdn100f}

add column separator

set{target,close*1.009}
add column target

draw ma(30)
set{q,8 day slope of ma(30)}
ADD COLUMN q

set{T10, count(10 day slope of the close above 0,1)}
set{T60, count(50 day slope of the close above 0,1)}
set{T200, count(200 day slope of the close above 0,1)}

Set{a1, T200 * 1}
Set{a2, T60 * 10}
Set{a3, T10 * 100}

Set{aa, a1 + a2}
Set{TREND, aa + a3}
set{T10a,days(10 day slope of the close below 0, 100)}
set{T60a,days(60 day slope of the close below 0, 100)}
set{T200a,days(200 day slope of the close below 0, 100)}
add column trend


add column separator
and add column gappeddn100
and add column gapdn100f
set {filldnpct , gapdn100f/gappeddn100}
add column filldnpct

SORT COLUMN 14 DESCENDING

set{OVERXMAX, OVERX 100 day high}
set{OVERXMIN, OVERX 100 day low}

and add column separator
add column OVERX
add column OVERXMAX
add column OVERXMIN

and add column separator
add column Long_Profit {Today}
add column Long_Profit 1 DAY AGO {-1 DAY}
add column Long_Profit 2 DAYS AGO {-2 DAY}
add column Long_Profit 3 DAYS AGO {-3 DAY}
add column Long_Profit 4 DAYS AGO {-4 DAY}
add column Long_Profit 5 DAYS AGO {-5 DAY}
add column Long_Profit 6 DAY AGO {-6 DAY}
add column Long_Profit 7 DAYS AGO {-7 DAY}
add column Long_Profit 8 DAYS AGO {-8 DAY}
add column Long_Profit 9 DAYS AGO {-9 DAY}

and add column separator
add column Long_Profit 10 DAYS AGO {-10 DAY}
]



and the short filter:

Fetcher[
/*OVERNIGHT SHORT*/

close above 8
avg volume(90) above 300000
OVERX above 79
do not draw OVERX
filluppct above 0.70
do not draw filluppct

set{Long_Profit1, close 1 day ago - low}
set{Long_Profit2, Long_Profit1 / close 1 day ago}
set{Long_Profit, Long_Profit2 * 100}
draw cma(Long_Profit, 100)

/* ENTER THE PERCENTAGE YOU WANT TESTED */
set{OVERX, count(Long_Profit > 0.89 , 100)}

set{Xgapped, open - close 1 day ago}
set{Xgapup, count(Xgapped > 0, 1)}
set{Xgapdn, count(Xgapped < 0, 1)}

set{gappedup100, count(Xgapup > 0, 100)}
set{gappeddn100, count(Xgapdn > 0, 100)}

set{cl1lo, close 1 day ago - low}
set{hicl1, high - close 1 day ago }

set{fillup, count(cl1lo > 0, 1)}
set{filldn, count(hicl1 > 0, 1)}

set{gapupfilled, Xgapup * fillup }
set{gapdnfilled, Xgapdn * filldn }

set{gapup100f, count(gapupfilled > 0, 100)}
set{gapdn100f, count(gapdnfilled > 0, 100)}

set{gapfilled, gapup100f + gapdn100f}

add column separator

set{target,close*0.991}
add column target

draw ma(30)
set{q,8 day slope of ma(30)}
add column q

set{T10, count(10 day slope of the close above 0,1)}
set{T50, count(50 day slope of the close above 0,1)}
set{T200, count(200 day slope of the close above 0,1)}

Set{a1, T200 * 1}
Set{a2, T50 * 10}
Set{a3, T10 * 100}

Set{aa, a1 + a2}
Set{TREND, aa + a3}
set{T10a,days(10 day slope of the close below 0, 100)}
set{T60a,days(60 day slope of the close below 0, 100)}
set{T200a,days(200 day slope of the close below 0, 100)}
ADD COLUMN TREND

add column separator
and add column gappedup100
and add column gapup100f
set {filluppct , gapup100f/gappedup100}
an add column filluppct

SORT COLUMN 14 DESCENDING

set{OVERXMAX, OVERX 100 day high}
set{OVERXMIN, OVERX 100 day low}

and add column separator
add column OVERX
add column OVERXMAX
add column OVERXMIN

and add column separator
add column Long_Profit {Today}
add column Long_Profit 1 DAY AGO {-1 DAY}
add column Long_Profit 2 DAYS AGO {-2 DAY}
add column Long_Profit 3 DAYS AGO {-3 DAY}
add column Long_Profit 4 DAYS AGO {-4 DAY}
add column Long_Profit 5 DAYS AGO {-5 DAY}
add column Long_Profit 6 DAY AGO {-6 DAY}
add column Long_Profit 7 DAYS AGO {-7 DAY}
add column Long_Profit 8 DAYS AGO {-8 DAY}
add column Long_Profit 9 DAYS AGO {-9 DAY}

and add column separator
add column Long_Profit 10 DAYS AGO {-10 DAY}
]



My vacation lasted 3 weeks and statistics did indeed prove correct: Roughly half of the positions are closed out within minutes after market open, and usually after 1 hour there would be 4 problem cases left in the portfolio.
In general it proved best to close those out between 10:30 and 11:30.

The testing period was with $3.500 per position on paper from sept 5 until sept 23. The first weeks went very well with daily profits averaging $250. Top day was over $800, worst was a $30 loss. One can imagine that I had a very pleasant vacation thinking about where to spend all the money flowing my way when going live with this strategy.
Then in the last three days things started to deteriorate. I got stuck with more losing positions and it became very hard to just break even. Nevertheless I went live when I got home, after all it would not be very realistic to think there would never be a losing streak. I did scale back a bit, taking on between 10 and 14 $2500 positions.

It has not been easy since, in the 3 weeks since going live there have only been a couple of days with tiny profits, I have switched back to paper a couple of times and of course those were the days with decent gains. I am currently back on
paper as I still think that this startegy should work.

So far I haven't used stop losses, but it in practice it turns out that losing positions rarely recover once the loss is beyond
3 to 4%. This seems reasonable, after all 4 out of 5 should be winners. The winners generate 4 x 1% and if you close the loser below 4 % there should be a profit in the long run.






StockFetcher Forums ·  · << 1 2 3 4 5 ... 106 >>

*** 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 2018 - 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