StockFetcher Forums · General Discussion · Can someone help me with this<< >>Post Follow-up
pa247
143 posts
msg #147797
Ignore pa247
5/15/2019 5:36:34 PM

Im trying to figure out the next step in this formula but not being successful.

I'd need to find which is the greater of the variables below. Thanks much

set{td1, todays high - todays low }
set{td2,todays high - yesterdays close}
set{td3,yesterdays close - todays low }

SAFeTRADE
548 posts
msg #147798
Ignore SAFeTRADE
5/15/2019 6:44:15 PM

Fetcher[set{td1, todays high - todays low }
set{td2,todays high - yesterdays close}
set{td3,yesterdays close - todays low }
try this.

set{x, max(td1,td2)}
set{higher_one, max(x,td3)}
add column higher_one
add column td1
add column td2
add column td3
]



xarlor
54 posts
msg #147801
Ignore xarlor
5/16/2019 2:17:35 PM

pa247, StockFetcher doesn't like your syntax. Use this instead:

Fetcher[
set{td1, high - low }
set{td2,high - close 1 day ago}
set{td3,close 1 day ago - low }

set{x, max(td1,td2)}
set{higher_one, max(x,td3)}
add column higher_one
add column td1
add column td2
add column td3
]



pa247
143 posts
msg #147803
Ignore pa247
modified
5/16/2019 3:06:12 PM

deleted.



pa247
143 posts
msg #147804
Ignore pa247
5/16/2019 3:33:24 PM

@xarlor... thanks!

Im still doing something wrong because now var2 always equals 1, which cant be correct. Need some more help please.

Fetcher[
market is etf

set{td1, high - low }
set{td2,high - close 1 day ago}
set{td3,close 1 day ago - low }

set{x, max(td1,td2)}
set{higher_one, max(x,td3)}

set{var1, ema(14)higher_one}
set{var2, higher_one/var1}
add column var1
add column var2
add column higher_one
add column td1
add column td2
add column td3
]







graftonian
810 posts
msg #147806
Ignore graftonian
5/16/2019 4:24:18 PM

PA, Try this
set{var1, cema(higher_one, 14)}


SAFeTRADE
548 posts
msg #147808
Ignore SAFeTRADE
modified
5/16/2019 4:50:29 PM

Fetcher[set{td1, todays high - todays low }
set{td2,todays high - yesterdays close}
set{td3,yesterdays close - todays low }


set{x, max(td1,td2)}
set{higher_one, max(x,td3)}
add column higher_one
add column td1
add column td2
add column td3
]




Filter works fine. Look at the columns. Use as you intended.

Safetrade

pa247
143 posts
msg #147811
Ignore pa247
5/16/2019 9:06:42 PM

Thanks all. Got it now.

nibor100
359 posts
msg #147840
Ignore nibor100
5/19/2019 11:38:51 AM

a few observations:

a. I don't believe the last filter posted is working as intended as the phrase "yesterdays close' seems to be interpreted by SF as today's closing value.

b. if you add columns for each of the values used in the computations you'll see what I mean, (high, low, close 1 day ago, yesterdays close, todays low, etc.)

c. It looks like pa247 is calculating Wilder's True Range for the most current day, a simpler approach might be to use SFs Average True Range function with a period of 1 day:

ATR(1)

with the added benefit of making the filter much shorter.

Hope this helps,
Ed S.


pa247
143 posts
msg #147847
Ignore pa247
5/20/2019 2:58:28 PM

@Ed S.

thank you! much better and doesnt crap out on me every other run. I have one more step im trying after the atr and it seems to work good.

thanks for the help
Paula

StockFetcher Forums · General Discussion · Can someone help me with this<< >>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 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