StockFetcher Forums · View by Author: (31 messages)  [ Display By: Date / Subject ]<< 1 2 3 4 >> 
Filter Exchange · help with code line
msg #150650
2/3/2020 3:39:45 PM

no syntax errors for me, worked fine

Filter Exchange · OBV filter from scratch
msg #150637
2/2/2020 2:44:34 PM


Filter Exchange · OBV filter from scratch
msg #150441
1/21/2020 4:42:55 PM


would anyone be able to help to create an OBV indicator from scratch?

I ask because i want to create a modified OBV and having the base OBV scripted would help. Thank you.


Filter Exchange · Best filter to detect breakouts
msg #149271
10/2/2019 7:39:51 PM


Thanks for the response!

a. it seems everything starts 3 days ago for some reason, can you explain why? as the 10 day high within 10 days is kind of within 13 days ago, etc.

This is a good question. I do this as part of my tweaking. I want to find a 10 day high a couple days from today. This really is just to give some space for the highs to form. But you are more than free to remove that, but you will have to also remove the offset or adjust the offset to whatever days away you want the filter to start looking for highs.

b. it appears you are filtering for Ipeak as both >3 and >0, I suspect SF is only using one of them.

Ah yes good catch. the ipeak>0 was there when I wasn't doing the days away from the previous question. SF considers today to be -1 so I had that in there so it would exclude any results that used today in it's calculation.

c. The variable GapDay and xdiff seem to be the same value, you can probably simplify your filter by using the same variable name in all places those 2 are named.

This i'm not too sure of. That would be a good suggestion but for me it was helpful to have a variable specifically named just to calculate the distance between the two highs that were being used.

hope that helps and thanks for your suggestions. Let me know if you want this same filter looking for breakdowns instead of breakouts

Filter Exchange · Best filter to detect breakouts
msg #149249
9/28/2019 3:38:14 PM

This is my best filter to detect breakouts. If it gives you a warning that you need the advanced subscription, simply click the filter to bring it up in the editor and click on "Fetch Stocks" button twice. It should populate the second time.

This filter detects breakouts by finding the 10 day high within 10 days and a 20 day high within 60 days and calculating the value if a trendline were to connect those two highs and extend it till today. After it calculates that it pulls up any stocks that has a close that crossed above that value. Hope this helps. Only finds descending trendlines

Any comments would be helpful or modifications

chart-length is 9 months
market is not otcbb
market is not etf

/*trendline calculation. finds 10 days high within 10 days and the 20 day high within 60 days and calculates the value if a line connected the two highs to today. The condition is when the price crosses above that calculated value*/
set{ipeak1offset, days(high reached new 10 day high,10) 3 days ago}
set{ipeak1, ipeak1offset + 3} /*add offset of days ago above*/
ipeak1 is above 3 /*add offset of days ago above*/
set{vpeak1, varOffset(high, ipeak1)}

set{ipeak2offset, days(high reached new 20 day high,50) 13 days ago}
set{ipeak2, ipeak2offset + 13} /*add offset of days ago above*/
ipeak2 is above 13 /*add offset of days ago above*/
set{vpeak2, varOffset(high, ipeak2)}

set{gapday, ipeak2-ipeak1}

vpeak2 is above vpeak1
ipeak2 is above ipeak1
ipeak1 is above 0
gapday is above 3

/*calculation to find value of the trendline today*/
set{ydiff, vpeak2-vpeak1}
set{xdiff, ipeak2-ipeak1}
set{slope, ydiff/xdiff}
set{mx, slope * ipeak2}
set{supportline, vpeak2-mx}
set{ratioclosetrend, close/supportline}

/*conditions when the close crosses above the calculated trendline*/
close crossed above supportline

/*debug columns*/
add column ipeak1
add column ipeak2
add column vpeak1
add column vpeak2
add column gapday
add column slope
add column supportline

do not draw vpeak1
do not draw vpeak2
do not draw ipeak1
do not draw ipeak2
do not draw supportline
do not draw gapday
do not draw ratioclosetrend

/*draws line at the highs used and value of the trendline if extended to today*/
draw price line at supportline
draw price line at vpeak1
draw price line at vpeak2

Filter Exchange · Modified OBV request/help!
msg #149233
9/24/2019 8:58:16 PM

@xarlor it seems like that calculation only uses the current day and the day before whereas I'm looking more of a accumulative indicator much like the obv where it is an accumulation of all the days before for each day

Filter Exchange · Modified OBV request/help!
msg #149232
9/24/2019 7:45:30 PM

@xarlor thanks for the response! Just looking at some of the few results I can see that there are some discrepancies since the obvx should never decrease on an up day but just quickly looking at it the value drops even on green days

Filter Exchange · Modified OBV request/help!
msg #149215
9/23/2019 10:19:43 PM


I'm trying to create an indicator that is similar to OBV but it includes the difference between todays close to yesterday's close as a multiplier for each day that is calculated.

for instance

Scenario 1:
stock close yesterday $5
stock close today $10
Volume: 100000

OBV would simply add 100000 to the previous value
Requested Indicator would add (10 yesterdays close - 5 today's close) 5 * 100000 = 500000 and 500000 will be added to the value of the indicator the day before.

Scenario 2:
stock close yesterday $10
stock close today $5
Volume: 100000

OBV would simply subract 100000 to the previous value
Requested Indicator would add (5yesterdays close - 10 today's close) -5 * 100000 = -500000 and -500000 will be added to the value of the indicator the day before.

Thank you in advance for any help

This is what I currently have but I know it isn't right

close is above 10
chart-length is 3 months
set{yesclose, close 1 day ago}
set{pricediff, close -yesclose}
set{volpricediff, volume * pricediff}
set{modOBV, sum(volpricediff,350)}
draw modOBV

General Discussion · Days filter mixed results
msg #144354
8/9/2018 7:01:48 AM

Thanks so much four and graftonian. you guys are really helpful. So, other than being able to save variables as constants (best solution), the only way to get this to be correct is by chunking the periods you want to check. modified below to get the correct result

chart-length is 6 months
set{high20day, days(high reached a new 20 day high, 20) 20 days ago}
set{highoffset, high20day + 20}
add column highoffset
set{20HI, high 20 day high}
draw 20HI on plot price

General Discussion · Problem with Variable in Count Phrase
msg #144351
8/8/2018 4:37:31 PM

can you define a variable as constant?

StockFetcher Forums ·  · << 1 2 3 4 >>

*** Disclaimer *** 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. does not recommend particular securities., 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