♥ 0 |
I am working on a study in which I need the ADX(14) of an higher time frame. I was thinking of using the “aggregationperiod” function, but ADX seems to be a very automated function/study. I can’t figure where I should specify the aggregationperiod within ADX function.
ADX study goes as follow: declare lower;
input length = 14; input averageType = AverageType.WILDERS;
plot ADX = DMI(length, averageType).ADX; ADX.setDefaultColor(GetColor(5)); RESOLVED
Marked as spam
|
Private answer
After Joey provided a bit more detail, I have a solution (although he still does not provide the higher time frame requested). Here is the full DMI indicator modified to read from Daily time frame. Screenshot below shows side-by-side charts. Daily on the left and hourly on the right. The chart on the right contains this code and plots the daily DMI on the hourly chart.
Marked as spam
|
Please log in to post questions.
Your first issue is that you are trying to reference the study plot instead of using the entire code. When folks run into trouble, it’s very often due to this very issue. Stop referencing studies and use the entire code. From the ADX we find that it is actually referencing a study named “DMI”. So you are trying to reference a study, that is referencing another study. See how quickly things can get tangled up?
So we need to use the entire code of the DMI study…. but you didn’t tell me which aggregation period you wanted to use???
Thanks for your answer. It is somehow what I was trying to achieve: I looked how ADX is calculated in my Wilders book! To then saw your comment and pay more attention to your code for your ADX in watchlist (where ADX calculation is break down).
So in the end, it was about having a more detail ADX calculation so that I can define the aggregationperiod for: high, low, close, …
To answer your curiosity/question. I need to evaluate ADX in different higher time frames, but whithin the same indicator which is already looking for other things in a smaller time frame.
I don’t want to do it through the watchlist, otherwise I will have too many columns in the watchlist.
Thanks again for your answer.