StockFetcher Forums · View by Author: (476 messages)  [ Display By: Date / Subject ]<< 1 2 3 4 5 ... 48 >> 
General Discussion · Scripting/Coding the data
xarlor
msg #159407
8/6/2022 9:56:08 AM

SF code is very rudimentary. Far less sophisticated than any of the ones you mentioned. If you wanted to compare it to an existing language, Pine would be the closest. But even Pine has the ability to do loops, functions, and unrestricted variable storage/recall. SF does not have these and limits use of more advanced indicators and ideas.

If you want to learn how to write your own filters in SF:

  • Read the User Guide from start to finish.
  • Study filters written by others through forum searches.
  • When you have a basic grasp, try to write your own and if it doesn't work, post on here with what you're trying to accomplish and the code you have so far.

That will get you to a point where you can start cranking out your own ideas. Sharing helps everyone as others will offer ideas you may not have thought of.

General Discussion · 2 closes above the 21 EMA
xarlor
msg #159399
8/5/2022 12:23:47 PM

You asked for one thing (closes above EMA twice), but your filter is for something different (close crossed above EMA twice). Not sure which you want, but here are both.

Fetcher[
count close above EMA(21),5 > 1
]



Fetcher[
count close crossed above EMA(21),5 > 1
]



General Discussion · how to show highest profit% gained on chart since scan
xarlor
msg #159331
7/24/2022 9:27:00 AM

A bit difficult trying to understand your request. Here is what I think you wanted:

Fetcher[
set{40h,close 40-day high}
close 41 days ago < 40h
set{profit1,40h / close 41 days ago}
set{profit2,profit1 - 1}
set{profit,profit2 * 100}

draw price line at 40h
add column close 41 days ago
add column 40h {40-day highest close}
add column profit
]



General Discussion · 2 different bollinger bandwidth scans and Why?
xarlor
msg #159326
7/23/2022 9:50:54 PM

In your first statement you are simply taking the difference between the upper and lower bands.

Bollinger Width does not do that:

The Bollinger Width returns the width of the upper and lower bollinger band divided by the n-day average price.
https://www.stockfetcher.com/sfforums2/index.php?tid=122

General Discussion · scanning for lower prices why different results
xarlor
msg #159325
7/23/2022 9:46:23 PM

"lower" is not a SF command:
https://www.stockfetcher.com/forums/Filter-Phrases

Filter Exchange · Bottom MA crossover filter help
xarlor
msg #159305
7/14/2022 6:02:10 PM

Fetcher[
close > MA(40)
close 1 day ago < 1
low 1 day ago reached a new 52 week low
]



Filter Exchange · Short team Call
xarlor
msg #159304
7/14/2022 5:49:32 PM

May I ask what your entry strategy is? DTE, delta?
Likewise, what is your exit strategy? Do you have a profit target you go for? Technical exit?

I prefer to trade with the trend to ensure high probability trades. Your hits each day are definitely lessened, but the quality of the trades increases drastically. My go-to trend filter is wma(150).

Fetcher[
Close is below MA(5)
Average volume(50) above 500,0000
RSI(2) below 5
stock market is ETF
optionable

close > wma(150) for last 30 days
]



Filter Exchange · Simplified Supertrend Swingtrade
xarlor
msg #159138
5/29/2022 5:50:27 PM

During the non-stop bull market of the past few years I would sometimes use Mobius' Supertrend indicator and scanner on ThinkOrSwim for entries and exits. As with all strategies, you have to adapt to changing market realities. I adapted the script for the current correction/bear scenario we are in.

I enter at the close and, this is very important, exit at the close of the next tick, full stop. It doesn't matter if the next tick is long or short, I exit. We are not in a trending environment and as such I'm not using this filter as a true Supertrend indicator. These are very quick trades, usually under a week

Fetcher[
/* Adapted from Mobius ToS Supertrend: https://usethinkscript.com/threads/supertrend-indicator-by-mobius-for-thinkorswim.7/ */
/* Enter at close. Exit on next tick, whether tick is long or short */
optionable
set{uptrend1,high + low}
set{uptrend2,uptrend1 / 2}
set{uptrend,uptrend2 + ATR(4)}
set{downtrend,uptrend2 - ATR(4)}

set{long,count(close > uptrend 1 day ago,1)}
set{short,count(close < downtrend 1 day ago,1)}

long > 0
short > -1

days(long 1 day ago equals 1,90) > days(short 1 day ago equals 1,90)
close > wma(150) for last 100 days

add column days(long 1 day ago equals 1,90)
add column days(short 1 day ago equals 1,90)

set{1up,uptrend 1 day ago}
set{1down,downtrend 1 day ago}

draw 1up on plot price
draw 1down on plot price
]



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)
]



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

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