StockFetcher Forums · General Discussion · Needing different Code<< >>Post Follow-up
Mactheriverrat
3,153 posts
msg #134270
Ignore Mactheriverrat
modified
2/13/2017 6:52:06 PM

Chart show clearly that the EMA(13) is above EMA(30) but filter column show -1. Any other type of code that can replace the BxB code. I wonder if this maybe a data matter that SF will have to fix. Just using KEM and CORT as example . CORT shows the right results where KEM doesn't when it come's to the BxB code.

Thanks
John
Submit
Fetcher[

apply to symlist(KEM,CORT)
Draw EMA(13)
draw EMA(30)
BxB is number of consecutive days EMA(13) above (+)/below(-) previous EMA(30) and set{BBb,days( EMA(13) is above EMA(30) 1 day ago,100)}
set{BBa,days( EMA(13) is below EMA(30) 1 day ago,100)} set{BxB, BBa - BBb} and add column BxB {B_x_B}

do not Draw BxB
Set{cnt1330,count( eMA(13) > eMA(30) 1day ago,1)}
draw cnt1330

Set{cnt1330b,count( eMA(13)< EMA(30) 1day ago,1)}

draw cnt1330b
]



four
5,087 posts
msg #134274
Ignore four
modified
2/14/2017 12:50:29 AM

-1 is a default that says that the requirement has occurred (KEM ema13/30 requirement has been in place for 100 days or more).

I increased the look back to 250 to capture the cross....

KEM has 215 days of ema13 above ema(30) 1 day ago.



Fetcher[
apply to symlist(KEM,CORT)
Draw EMA(13)
draw EMA(30)
/* BxB is number of consecutive days EMA(13) above (+)/below(-) previous EMA(30) */
set{BBb,days( EMA(13) is above EMA(30) 1 day ago,250)}
set{BBa,days( EMA(13) is below EMA(30) 1 day ago,250)}
set{BxB, BBa - BBb} and add column BxB {B_x_B}

do not Draw BxB
Set{cnt1330,count( eMA(13) > eMA(30) 1day ago,1)}
draw cnt1330

Set{cnt1330b,count( eMA(13)< EMA(30) 1day ago,1)}

draw cnt1330b

]



Mactheriverrat
3,153 posts
msg #134275
Ignore Mactheriverrat
2/14/2017 2:05:43 AM

A big thanks FOUR- The code works GREAT!!!!!!!!



four
5,087 posts
msg #134276
Ignore four
2/14/2017 2:25:01 AM

welcome

nibor100
1,031 posts
msg #134290
Ignore nibor100
2/14/2017 2:05:23 PM

@four,

given that SF defines the results of the days(event,#) command as "it returns the number of days since the event most recently occurred'

Do you know why do the filters above end up with BBb = 0 ;when clearly there is a quantity of days since the most recent occurrence of EMA(13) above EMA(30) for both of those stocks?

It seems like the days command definition might be missing some important characterizing info.

Thanks,
Ed S.

four
5,087 posts
msg #134302
Ignore four
modified
2/14/2017 7:05:23 PM

nibor,

Today is day "0", the criteria is met today = 0. Today is the most recent day the criteria is met:
EMA(13) is above EMA(30) 1 day ago. Thus bbb = 0.

StockFetcher Forums · General Discussion · Needing different Code<< >>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.