Pre market and After Hours News Alerts


Category:
0
0

Hello Pete.

What I am looking to do is create a scan that alerts me of recent news on companies I have in my watchlists. Much like the Earnings scan, this would operate the same way. I tried to change the code for the Earnings scanner, but I can’t get past the errors. Can you offer some guidance? Thank you.

rec preEarningsClose = if HasEarnings(EarningTime.BEFORE_MARKET) then close[1] else if HasEarnings(EarningTime.AFTER_MARKET) then close else preEarningsClose[1];
rec postEarningsOpen = if HasEarnings(EarningTime.BEFORE_MARKET)[1] then open[1] else if HasEarnings(EarningTime.AFTER_MARKET)[1] then open else postEarningsOpen[1];
rec percentEarningsMove = if HasEarnings(EarningTime.AFTER_MARKET)[1] then 100 * (preEarningsClose[1] / postEarningsOpen – 1) else if HasEarnings(EarningTime.BEFORE_MARKET) then 100 * (preEarningsClose / postEarningsOpen – 1) else percentEarningsMove[1];
plot scan = percentEarningsMove > 9.0;

 

Marked as spam
Posted by A. D. Whitsett (Questions: 6, Answers: 12)
Asked on July 12, 2018 12:57 pm
798 views
0
Private answer

At this time there is nothing in the platform that permits us to write code that can reference news events.

Marked as spam
Posted by Pete Hahn (Questions: 37, Answers: 4153)
Answered on July 12, 2018 1:15 pm
0

Thank you, Pete. I saw some of the keywords that had Events, and Get events to offset. Wasn’t sure how to put that together without working around the errors.

(A. D. Whitsett at July 12, 2018 1:23 pm)
0

“…keywords that had events…” “…get events to offset…” I am completely lost there. What are these “keywords” and where did you see them? Are you talking about the method named GetEventsOffset() which uses the list of “constants” found here: http://toslc.thinkorswim.com/center/reference/thinkScript/Constants/Events.html

(Pete Hahn at July 12, 2018 1:48 pm)
0

Hello Pete,
These are in the think script references and when you’re typing in the codes, it auto-suggests them. I figured those could be substituted for what you used in your earnings scan.

(A. D. Whitsett at July 13, 2018 6:17 pm)