StockFetcher Forums · General Discussion · Point system<< >>Post Follow-up
Lanclos
4 posts
msg #127456
Ignore Lanclos
3/1/2016 2:09:36 PM

Can someone help me answer how do I give a point to a variable?

Example) If SAR changes direction in the past 10 days assign variable to 1

/* Parabolic SAR cross last 10 days */
set ParSarVar = 1 if Parabolic SAR(0.02,0.2) crossed below close within last 10 days

Thanks



SAFeTRADE
346 posts
msg #127459
Ignore SAFeTRADE
3/1/2016 8:32:29 PM

Try this, it may be to your liking.
Fetcher[
set{psarx, count(Parabolic SAR(0.02,0.2) crossed below close within last 10 days,1)}

draw Parabolic SAR(0.02,0.2)
draw psarx

dow 30
]



Kevin_in_GA
4,214 posts
msg #127466
Ignore Kevin_in_GA
3/2/2016 9:51:10 AM

Not exactly. I would code it this way:

Fetcher[

set{psarx, count(Parabolic SAR(0.02,0.2) crossed below close,10)}
psarx above 0.5
draw Parabolic SAR(0.02,0.2)
draw psarx
dow 30
]



This way should give you a signal for any time within the last 10 days that the cross below occurred. I get 23 results where your code gave all 30 stocks - note that CSCO, JNJ, KO, MRK, PFE, TRW, and XOM all had crossovers more than 10 days ago but still show up in your screen.

StockFetcher Forums · General Discussion · Point system<< >>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