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'm totally noob to EL, so sorry if this bothers you a bit, but any help would be greatly appreciated.
I'd like to know how to reference past data and calculate the information at that specific time. I've read the books and understand how to reference past data based on time/date. But, when it comes to caculate series of data FROM a specific time in the past, i'm a bit stuck.
Example:
-I'm at time 1000
-I want to calculate MACD (Close, 8,23,11) NOT at current time but FROM 0959, then FROM 0958, so on and so forth for the past 5 min.
I was able to program the function to calculate the MACD from current time. But, i don't know how to reference and calculate from a specific time in the past without referencing the exact time in my code. i want my code to reference, t-1min, t-2min, t-3min, etc...
Can you help answer these questions from other members on NexusFi?
I am not exactly sure if I understand you correctly, but wouldn't it work to access the previous values for the MACD directly? If you store the MACD in a variable, you can access its previous values like with any other variable.
If i use the MACD function, it will calculate the current close price of current bar plus the close price of previous bars as i specified.
Doing so, i might not get the correct data if the current bar hasn't closed yet. Say i'm using a 1min chart and i'm 15seconds into the bar.
If i'm at 1000 and calculate the MACD into 15seconds (at time 10:00:15) of the current bar and store it, that data is not accurate because the bar has not closed yet. In the same line of thought, it'd only accurate if i calculate the MACD from 0959 since the data is complete.
I might not fully understand the whole thing, but judging from MACD graph in TS, the MACD histogram of the current bar moves up/down as the market evolves.
If i use MACD[11], it will calculate MACD from the current bar with the previous number of bars as indicated. I'm right or wrong?
Let's assume you have a variable called MACD, then MACD[11] will be the value that variable had at the close 11 bars before the current bar.
I am still unclear of what you are trying to achieve, but you will likely run into issues when you try to access intrabar timestamps. In indicators you can't directly access intrabar information for historical bars and in signals with intrabar order generation I'd say from the top of the head the exact timestamp of the ticks is not available in Tradestation (definitely not via legacy EasyLanguage and I wouldn't suggest using OOEL concepts without having a solid understanding of EasyLanguage first).
Ok, I think i understand now. Please tell me if i'm right.
So i'm at time 1000.
If i use EL MACD function as it, it will calculate the current bar data with previous close as indicated in the function variable.
If i use MACD(Close,9,14)[1], it will calculate the data from bar at 0959. MACD(Close,9,14)[2] from bar at 0958, so on and so forth. Am i correct?
Basically, i'm trying to use the MACDDiff value from each of the previous 5 bars.
Plot1 and Plot3 give you the same result as it's basically the same statement.
In the beginning Plot2 will differ as you start with a different price.
On a long enough timeline Plot2 will closely match the other two, too. This is caused by the nature of the exponential average that will contain traces of all data points.
If the method used for Plot2 gives you what you are looking for, then use that.
By the way you can show your appreciation for a post here on Futures.io using the "Thanks" button under it.