StockFetcher Forums · Filter Exchange · Coding Question..<< >>Post Follow-up
stratiG
147 posts
msg #119213
Ignore stratiG
4/25/2014 4:14:30 PM

How would you determine the %return since a signal occurred?

example: 5 days ago x happened(filter result) whats the %move from that date to today.

I think I saw some code here in the past year that does this. Any help would be much appreciated.

Thanks,
George

four
5,087 posts
msg #119216
Ignore four
modified
4/25/2014 4:59:36 PM

3 days ago x happened (filter result) whats the %move from that date (open) to today (close).

Fetcher[

set{x, days(ema(10) crossed above ema(77),5) }
add column x equals 3
draw ema(10)
draw ema(77)
offset 4/9/14
sp500

draw x line at 3
set{z, close - open 3 days ago}
set{zz, z / close}
add column separator
add column z{diff}
add column open 3 days ago{o_3ago}
add column close{c_tdy}
add column zz{percent}
]




stratiG
147 posts
msg #119220
Ignore stratiG
4/26/2014 9:34:36 AM

thanks


Kevin_in_GA
4,599 posts
msg #119221
Ignore Kevin_in_GA
4/26/2014 9:59:17 AM

This is why we need a function like ValueWhen(X,Y) where X is the variable whose value is desired (e.g., close) and Y is the specific condition that was met.

Example - ValueWhen(close, rsi(2) crossed above cma(rsi(2),10))

There could be lots of uses for something like this.

four
5,087 posts
msg #119222
Ignore four
4/26/2014 2:54:13 PM

stratiG
- Welcome

StockFetcher Forums · Filter Exchange · Coding Question..<< >>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.