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.
-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...
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, 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 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).
The following user says Thank You to ABCTG for this post:
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.
The following 2 users say Thank You to ABCTG for this post: