StockFetcher Forums · View by Author: (468 messages)  [ Display By: Date / Subject ]<< 1 2 3 4 5 ... 47 >> 
Filter Exchange · Bottom Filter
xarlor
msg #159054
5/11/2022 9:59:20 AM

The problem with writing this in SF is the lack of looping capability. I took a stab at it and the results are not correct. Still, I'm posting it here in case someone wants to debug, improve, or point out where my logic is wrong.

Fetcher[
sp500

set{fast,40}
set{slow,60}
set{a1,5/fast}
set{a2,5/slow}

set{PB1a,a1 - a2}
set{PB1b,PB1a * close}
set{PB1b_1,PB1a * close 1 day ago}
set{PB1b_2,PB1a * close 2 days ago}

set{PB2a,1 - a1}
set{PB2b,a2 * PB2a}
set{PB2c,1 - a2}
set{PB2d,a1 * PB2c}
set{PB2e,PB2b - PB2d}
set{PB2f,PB2e * close 1 day ago}
set{PB2f_2,PB2e * close 2 days ago}
set{PB2f_3,PB2e * close 3 days ago}

set{PBt,PB1b + PB2f}
set{PBt1,PB1b_1 + PB2f_2}
set{PBt2,PB1b_2 + PB2f_3}

set{PB3a,PB2a + PB2c}
set{PB3b,PB3a * PBt1}

set{PB4a,PB2a * PB2c}
set{PB4b,PB4a * PBt2}

set{PBsum1,PBt + PB3b}
set{PB,PBsum1 - PB4b}

set{RMSa1,PB * PB}
set{RMSa,RMSa1 + 50}

set{RMSplus1,RMSa / 50}
set{RMSplus,pow(RMSplus1,0.5)}
set{RMSminus,1 - RMSplus}

draw PB
draw RMSplus on plot PB
draw RMSminus on plot PB

add column separator
add column PB
add column RMSplus
add column RMSminus

chart-time 1 year
]



Filter Exchange · Moving Average of Moving Average
xarlor
msg #158980
modified
4/16/2022 9:08:47 PM

Welcome to the StockFetcher community, bconnell!

Very interesting results on the ema(5), cma(ema(5),6) crossover. I've made some additions/changes based on my trading style.

  • I took out all the noise as I prefer my charts a bit cleaner. Completely personal preference here.
  • To catch the start of the run, I only display tickers who just performed the crossover.
  • I noticed these tend to run a lot longer if they are already in an uptrend (defined by me as close above wma(150)). It still works if the stock is in a downtrend, but the runs are short; a lot of times very short and not worth it to me.
  • I sorted the results by those in an uptrend first. Depending on how that goes, I may just remove the downtrend ones and only display the uptrends. Starting out, I want to see the performance of both trends.
Again, kudos to finding this pattern and an even bigger thank you for sharing. Looking quite promising.

Fetcher[
index is dow 30

Set{EMA56LONG,count( ema(5) > cma(ema(5),6) ,1)}
draw EMA56LONG

Set{EMA56SHORT,count( ema(5) < cma(ema(5),6) ,1)}
draw EMA56SHORT

ema56long > 0
ema56long 1 day ago equals 0

set{Uptrend,count(close > wma(150),1)}
set{Downtrend,count(close < wma(150),1)}
add column Uptrend
add column Downtrend
sort column 5 descending

draw ema(5)
draw cma(ema(5),6)
draw wma(150)
]



General Discussion · Learning
xarlor
msg #158962
4/10/2022 1:56:45 PM

There are several swing-trading filters to determine trends. Chop Zone is good on non-choppy tickers. For example, not so good on EEM and XLP.

The issue, no filter is going to eliminate whipsaws. I use trend filters to inform how to trade.

Is the general market in uptrend (SPY, QQQ, DIA)? Then I trade aggressively.
Is it in a downtrend? I don't stop trading, but I do lower my participation drastically and use more bearish trades.
Choppy market? Use neutral strategies.

Fetcher[

symlist(EEM,EWW,EWZ,FXI,GLD,HYG,IYR,QQQ,SLV,SPY,TLT,USO,SBI,XLE,XLF,XLP,XLU,XOP,XRT)

set{hlc3a,high + low}
set{hlc3b,hlc3a + close}
set{hlc3,hlc3b / 3}

set{number1,1}
set{pi,atan(number1) * 4}

set{h30,high 30-day high}
set{l30,low 30-day low}
set{range1,h30 - l30}
set{range2,range1 * l30}
set{range,25 / range2}

set{x1_ema34,0}
set{x2_ema34,1}
set{y1_ema34,0}
set{y2a,ema(34) 1 day ago - ema(34)}
set{y2b,hlc3 * range}
set{y2_ema34,y2a / y2b}

set{c1a,x2_ema34 - x1_ema34}
set{c1b,x2_ema34 - x1_ema34}
set{c1c,y2_ema34 - y1_ema34}
set{c1d,y2_ema34 - y1_ema34}
set{c1e,c1a * c1b}
set{c1f,c1c * c1d}
set{c1g,c1e + c1f}
set{c_ema34,sqrt(c1g)}

set{emaAngle1,x2_ema34 - x1_ema34}
set{emaAngle2,emaAngle1 / c_ema34}
set{emaAngle3,emaAngle2 / pi}
set{emaAngle4,acos(emaAngle3)}
set{emaAngle5,180 * emaAngle4}
set{emaAngle_1,round(emaAngle5)}

set{emaAngle6,count(y2_ema34 > 0,1)}
set{emaAngle7,count(y2_ema34 < 0,1)}
set{emaAngle8,emaAngle7 - emaAngle6}
set{emaAngle,emaAngle8 * emaAngle_1}

set{LONG,count(emaAngle > 5,1)}
set{SHORT,count(emaAngle < -5,1)}

LONG > -1
SHORT > -1
]



General Discussion · Learning
xarlor
msg #158955
4/9/2022 10:32:15 AM

@snappyfrog, I've been trading Iron Condors on IWM lately with success. It's trending sideways since February. The price lines below are my current breakevens for May 20 expiration. It's nice when they match up with the channel so closely.



General Discussion · Learning
xarlor
msg #158951
4/8/2022 6:17:33 PM

This is so true, especially during downtrends. Trading isn't just something to do in bull markets. Everyone should learn strategies to make money both when the market is heading up and also when it's heading down.

Filter Exchange · 52 week high help
xarlor
msg #158914
4/1/2022 7:54:26 AM

Fetcher[
/* Your request */
count(high 1 day ago < high 52 week high 1 day ago,5) equals 5
high equals high 52 week high

/* Extra visuals, bells, and whistles */
add column separator
add column days(high 1 day ago equals high 52 week high 1 day ago,252) {Days since last 52-week high}
add column high 52 week high 1 day ago
add column high 52 week high

draw price line at high 52 week high 1 day ago
do not draw high 52 week high
sort column 6 descending
]



General Discussion · Compare price to price of another stock, e.g. SPY
xarlor
msg #158911
3/31/2022 11:26:11 AM

Fetcher[
set{SPY_close,ind(SPY,close)}
set{my_indicator,close / SPY_close}

add column SPY_close
add column my_indicator
]



General Discussion · ATR above BB issue
xarlor
msg #158861
3/22/2022 2:36:32 PM

Here is the filter you were attempting:

Fetcher[
not otcbb
not etf

draw Upper Bollinger Band(20,2)
draw Lower Bollinger Band(20,2)
draw atr(21) on plot price
draw x2 on plot price
draw x3 on plot price

set{x1,atr(21) * 3}
set{x2,x1 + close}
set{x3,x1 - close}

x2 > Upper Bollinger Band(20,2)
x3 > Lower Bollinger Band(20,2)

close > 7
close > weekly upper bollinger band(20,2) 26 weeks ago
weekly average volume(30) > 3,000,000
close is less than 25% below high 52 week close
]



However, your methodology is flawed in trying to fit ATR(21) * 3 inside Bollinger Bands. Look at the individual calculations on PANW:

Fetcher[
symlist(PANW)
not otcbb
not etf

draw Upper Bollinger Band(20,2)
draw Lower Bollinger Band(20,2)
draw x1 on plot price
draw x2 on plot price
draw x3 on plot price

set{x1,atr(21) * 3}
set{x2,x1 + close}
set{x3,x1 - close}

add column separator
add column x1
add column separator
add column x2
set{UBB,Upper Bollinger Band(20,2)}
add column UBB
add column separator
add column x3
add column Lower Bollinger Band(20,2) {LBB}

/*
x2 > Upper Bollinger Band(20,2)
x3 > Lower Bollinger Band(20,2)

close > 7
close > weekly upper bollinger band(20,2) 26 weeks ago
weekly average volume(30) > 3,000,000
close is less than 25% below high 52 week close
*/
]



General Discussion · A possible true false logic alternative
xarlor
msg #158816
3/14/2022 3:39:49 PM

@nibor
I misunderstood your request. I thought you were testing basic vs advanced filters. I don't have any filters that fail to run in SF due to complexity as I delete any that break. I'll let you know if I come across any, though!

Filter Exchange · Short Trade - 2-Candle Pattern
xarlor
msg #158800
3/13/2022 11:59:23 AM

Stumbled upon this and saw it never got a response. It's over 3 years late, but better that than never!

Fetcher[
open < high 1 day ago
close < high 1 day ago
open > close 1 day ago
open > open 1 day ago
close > close 1 day ago
close > open 1 day ago
open > close

set{body,abs(open minus close)}
set{body_top,max(open,close)}
set{head,high - body_top}
body 1 day ago between 0 and 0.02
head > body

do not draw head
do not draw body
]



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

*** 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 2021 - 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.