StockFetcher Forums · General Discussion · Question for code Gurus<< >>Post Follow-up
SAFeTRADE
656 posts
msg #161988
Ignore SAFeTRADE
10/8/2025 10:49:21 AM

buy when high reaches a new 13 day high and
has an increasing ma(45) and
8 day low at least 1 step higher preferably 2

coding looks like :

set{13hi,count(high reached a new 13 day high,1)}
set{incm45,count(ma(45) > ma(45) 4 days ago,1)}

how to code 8 day low 1 or 2 steps higher?

Look at NVDA below to see stair step of 8 day low

Fetcher[symlist(nvda)
set{psar10,Parabolic SAR(0.10,0.2)}
set{cls,close}
draw ma(45)
draw ma(13)
draw high 13 day high
draw low 8 day low
set{x,count(high reached a new 13 day high,1)}
set{sell,count(low reached a new 8 day low,1)}
draw x
draw sell
]



SAFeTRADE
656 posts
msg #161989
Ignore SAFeTRADE
10/8/2025 11:07:20 AM

This my first attempt :


Fetcher[symlist(nvda,spy)
set{13h,count(high reached a new 13 day high,1)}
set{8l,count(low reached a new 8 day low,1)}
set{ldb,count(Donchian Lower Band(8,4) increasing last 10 days,1)}
set{dbh,Donchian Upper Band(13,4)}
set{dbl,Donchian lower Band(8,4)}
draw dbh on plot price
draw dbl on plot price
draw ma(45)
draw ma(13)
draw 13h
draw ldb
draw 8l
]



SAFeTRADE
656 posts
msg #161990
Ignore SAFeTRADE
10/8/2025 11:55:04 AM

Attempt 2:

Fetcher[set{kshi, High 22 day High}
set{kslo, Low 22 day Low}
set{ks1, kshi+kslo}
set{Kijun_Sen, ks1 / 2}
set{cls,close}

watchlist(nasdaq100)
set{higherma13,count(ma(13) > ma(13) 4 dats ago,1)}
set{13h,count(high reached a new 13 day high,1)}
set{8l,count(low reached a new 8 day low,1)}
set{ldb,count(Donchian Lower Band(8,4) increasing last 10 days,1)}
set{dbh,Donchian Upper Band(13,4)}
set{dbl,Donchian lower Band(8,4)}
set{rank1,higherma13 + ldb}
set{rank,rank1 + 13h}
draw dbh on plot price
draw dbl on plot price
draw ma(45)
draw ma(13)
draw 13h
draw ldb
draw higherma13
draw 8l
draw Kijun_Sen on plot cls
add column rank
sort column 5 descending
]



SAFeTRADE
656 posts
msg #161991
Ignore SAFeTRADE
10/8/2025 2:51:51 PM

While I have you attentiin, have any of you used AI to build a python filter as an example a Weinstein
filter?

xarlor
614 posts
msg #161992
Ignore xarlor
10/8/2025 3:40:35 PM

Try this. Increase the days to count to fit your preference and make the last line your preference - 1.

set{lowstepper1,low 8-day low}
set{lowstepper2,low 8-day low 1 day ago}
set{lowstepper,count(lowstepper1 >= lowstepper2,8)}
lowstepper > 7


Fetcher[
set{psar10,Parabolic SAR(0.10,0.2)}
set{cls,close}
draw ma(45)
draw ma(13)
draw high 13 day high
draw low 8 day low
set{x,count(high reached a new 13 day high,1)}
set{sell,count(low reached a new 8 day low,1)}
set{lowstepper1,low 8-day low}
set{lowstepper2,low 8-day low 1 day ago}
set{lowstepper,count(lowstepper1 >= lowstepper2,8)}
lowstepper > 7

draw x
draw sell
]



SAFeTRADE
656 posts
msg #161993
Ignore SAFeTRADE
10/8/2025 5:20:52 PM

Thanks xarlor your code gave me an idea. This is a much cleaner chart with the signals clearly visible.
This stepper idea comes from Mark Minervini, he also uses VCP which I am attempting to code in
stockfetcher.. Stepper signaling 1 means itis a stepper from on e to infinity (well not infinity only until
it is not a stepper). I also added dn_step to show when the run potentially ends.



Fetcher[set{dlb,Donchian Lower Band(14,4)}
set{dlbx,count(Donchian Lower Band(14,4) > Donchian Lower Band(14,4) one day ago,1)}
SET{DN_STEP,COUNT(Donchian Lower Band(14,4) < Donchian Lower Band(14,4) 1 DAY AGO,1)}
symlist(spy,AAPL,NVDA)
set{since, days(DLBX EQUAL 1, 10)}
SET{STEPPER,COUNT(SINCE > .5,1)}
draw dlb on plot price
draw ma(45)

draw dlbx
drAW STEPPER
draw dn_step
draw Williams %R(20) line at -10
]



StockFetcher Forums · General Discussion · Question for code Gurus<< >>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.