Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am trying to get a close price based on certain previous date, right now is based on EX-Dividend date, however TOS doesnt allow me to use that date. Below code for reference
#I can declare the X amount of days since last Ex Div Date
def LastXDiv= (GetEventOffset(Events.DIVIDEND, -1));
#But unable to put it under close parameters as below, it does not accept the Def variable LastXDiv or if I type out it all out.
#def LastXDivClose = close[GetEventOffset(Events.DIVIDEND, -1)];
#However I can get TOS to accept as below, but this would the result would be the next amount dividend days, not for previous.
def LastXDivClose = close[Events.DIVIDEND];
#right now I can only way I can get it to semi-working is to put label and find out X amount of days then change the input manually each time, but too tedious and wondering any work around for it.
Thanks, but I tried that and seems doesn't work, as I want to get the DayClose of the Last Previous Div date, but when I use your code and just add one extra line, and use the "daysSinceDivvie" as the length number for Close it doesn't accept it as says it only accepts constant. Which is the same error I got when I did it my way.