earning date on TOS


Category:
0
0

hello….I have a question about earning date….is there possible to put next earning date in custom watchlists column ?

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on February 11, 2019 11:25 pm
598 views
1
Private answer

There is no way to display next earnings date in a watchlist. The best we can accomplish from existing code is to display a 1 or 0 based on whether there is a futures earnings announcement within a specified number of days.

Here is the code. Taken directly from a built in scan filter named “Earnings”.

Input length = 10;
input choice = {default "Has", "Does Not Have" };
input Choice2 = {default "Any time", "Before the Market", "After the Market"};
def earnings = hasearnings();
def when;
switch (Choice2){
case "Any time":
when = hasearnings();
case "Before the Market":
when = HasEarnings(type = EarningTime.BEFORE_MARKET);
case "After the Market":
when = HasEarnings(type = EarningTime.AFTER_MARKET);
}
plot scan;
switch (Choice){
case "Has":
scan = sum(when,length)[-length +1] > 0;
case "Does Not Have":
scan = sum(when,length)[-length +1] == 0;
}

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on February 15, 2019 1:59 pm