NexusFi: Find Your Edge


Home Menu

 





Earnings Label


Discussion in ThinkOrSwim

Updated
    1. trending_up 2,574 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
skynetgen
Randolph
 
Posts: 4 since Jul 2018
Thanks Given: 8
Thanks Received: 0

Displays a label on daily chart. If stock has earnings coming in next 5 days or had it 2 days ago
 
Code
declare once_per_bar;

def pastoffset =GetEventOffset(Events.EARNINGS,-1);
def futureoffset =GetEventOffset(Events.EARNINGS);

def earningsAnnounced=HasEarnings(EarningTime.ANY);
def isBefore = HasEarnings(EarningTime.BEFORE_MARKET);
def isAfter = HasEarnings(EarningTime.AFTER_MARKET);
def isDuringOrUnspecified = HasEarnings() and !isBefore and !isAfter;

def nearEarnings=pastoffset <=2 or (futureoffset>=-5 and HasEarnings()) or futureoffset==-1 ;
def offset = if pastoffset < absvalue(futureoffset) or !earningsAnnounced  
             then pastoffset else futureoffset;

AddLabel(   nearEarnings,"Earnings " 
    +(if offset <0 then  "in " +(-offset)
   else if  offset>0 then offset + " ago"
   else  if !earningsAnnounced then "no announce" 
   else "Today ")
   + (if isbefore then "PreMkt" else if isafter then "AftHrs" else "") 
    ,
    if offset < 0 then  Color.MAGENTA else color.LIGHT_ORANGE);
#debug
#AddLabel( yes," EarnDebug " +"Anounce "+ earningsAnnounced +"\ " + pastoffset+"|"+futureoffset + (if isbefore then "PM" else if isafter then "AH" else "") , color.blue);


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
My Rant with AMP Futures
Trading Reviews and Vendors
Trump Media to sell instant access to market-moving soci …
Traders Hideout
Datafeed for Atas
Platforms and Indicators
No book, only a stair: journaling fills where price move …
Cryptocurrency
EA
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #2 (permalink)
 castone1 
Greenville, South Carolina
 
Experience: Advanced
Platform: NinjaTrader
Trading: Stocks
Posts: 2 since Apr 2015
Thanks Given: 0
Thanks Received: 1

Do you know if anyone has an earnings label indicator for NinjaTrader 8 charts?


Reply With Quote




Last Updated on July 14, 2020


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts