StockFetcher Forums · General Discussion · Count of value in between two user values<< >>Post Follow-up
push5280
201 posts
msg #160815
Ignore push5280
modified
1/30/2024 8:44:29 PM

Need some help from the group. I'm thinking this is giving me an error because I'm using two user defined values or is it because "count" and "in between" hate each other?
Fetcher[
set{6molo_30pct, close 6 month low * 1.3}

set{6mohi_70pct, close 6 month high * .7}
set{stage1, count(ema(5) < 6molo_30pct,1)}
set{stage2c, count(ema(5) is between 6molo_30pct and 6mohi_70pct ,1)}
set{stage2, stage2c * 2}
draw stage1
draw stage2
]



redversa721
157 posts
msg #160817
Ignore redversa721
1/31/2024 2:35:32 AM

Can you break down the in between step into 2 pieces
stagec1 is count (ema> 6molo,1)
stagec2 is count(ema< 6mohi,1)

not sure if this would work but thought i'll just ket you know

xarlor
587 posts
msg #160819
Ignore xarlor
1/31/2024 9:47:03 AM

Fetcher[
set{6molo_30pct, close 6 month low * 1.3}
set{6mohi_70pct, close 6 month high * .7}

set{stage1, count(ema(5) < 6molo_30pct,1)}
set{stage2a,count(ema(5) > 6molo_30pct,1)}
set{stage2b,count(ema(5) < 6mohi_70pct,1)}
set{stage2c,stage2a * stage2b}
set{stage2, stage2c * 2}

draw stage1
draw stage2
]



nibor100
1,044 posts
msg #160825
Ignore nibor100
2/1/2024 2:24:46 AM

You can use count and "is between" together in a statement if SF, however it is my understanding that SF will only apply "is between" to actual numbers, not defined variables.

For example this statement should work:

add column count(ema(5) is between 10 and 20,1)

hope this helps,
Ed S.

push5280
201 posts
msg #160832
Ignore push5280
2/1/2024 12:35:09 PM

Thanks Ed!

I thought that using user defined variables was what was causing the issue but I couldn't find any documentation on limitations. I appreciate your help.

StockFetcher Forums · General Discussion · Count of value in between two user values<< >>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.