StockFetcher Forums · General Discussion · Values assigned based on Calc Values?<< >>Post Follow-up
mslattery@dc.rr.com
86 posts
msg #105713
Ignore mslattery@dc.rr.com
3/28/2012 2:30:06 AM

Can someone provide me with the correct format to accomplish the following?

I want to assign values to the following percentages derived from the difference between the High of the day and the Close of the Day.

I want to assign the value of: "5" if the resulting % is less than .25%
of: "4" if the resulting % is less than .50%
of: "3" if the resulting % is less than 1%
of: "2" if the resulting % is less than 2%
of: "1" if the resulting % is less than 3.5%
of: "0" if the resulting % is greater than 3.5%.

Thanks, Michael



Kevin_in_GA
4,553 posts
msg #105721
Ignore Kevin_in_GA
3/28/2012 12:30:13 PM

I don't think this can be done. You are thinking this is like an IF() statement in Excel, the current SF programming language does not support this.



mslattery@dc.rr.com
86 posts
msg #105723
Ignore mslattery@dc.rr.com
3/28/2012 2:15:52 PM

Thanks Kevin:

Yes, I was actually trying to get an excel function out of excel and into SF.

I was hoping that someone had tricked this out.

Michael

traderseb
36 posts
msg #105732
Ignore traderseb
3/29/2012 8:01:07 AM

This might work......
Fetcher[
set{diff, high - close}
set{diffP, diff / close}
set{diffP1,diffP * 100}
set{cnt1,count( diffP1 < 3.5,1)}
set{cnt2,count( diffP1 < 2,1)}
set{cnt3,count( diffP1 < 1,1)}
set{cnt4,count( diffP1 < 0.5,1)}
set{cnt5,count( diffP1 < 0.2,1)}
set{sum1,cnt1 + cnt2}
set{sum2,cnt3 + cnt4}
set{sum3,sum1 + sum2}
set{sum4,sum3 + cnt5}

close above 100
volume above 10000000
add column high
add column close
add column diff
add column diffP
add column diffP1
add column sum4
]





StockFetcher Forums · General Discussion · Values assigned based on Calc 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 2016 - 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