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)
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
This indicator uses EMA's whose periods vary from bar to bar.
The usual method of creating reusable instances of the external EMA's breaks down because each of those instances would only have one period, and you may not know in advance how many different values of periods would ultimately be needed for those EMA's, or what the values of those periods would be. (For this indicator, the number of different MA periods ends up being about the same as the Period of the indicator.)
This problem can be solved by using Dictionary objects that hold collections of EMA classes having the needed parameters. For each entry, the key is an integer and the value is an instance of an EMA class, including the value of its parameters. For each entry we simply make the value of the smoothing period the same as that of the key. Of course, before attempting to Add a value to the Dictionary, you must make sure that the Dictionary does not already contain an entry having that key by doing a ContainsKey test.
Once the Dictionary contains an entry having a given key, for example 7, you just call for that value whenever you need an EMA with a period of 7. For example, result = EMADictionary[7][0], where the key is 7 and the value is EMA(HolyGrailDataSeries,7) gives result = EMA(HolyGrailDataSeries,7)[0].
Simple! Works great! I learned it all from @gomi ! I don't think that those people whose first names begin with N have thought of this, and it is doubtless "unfortunately beyond the scope of anything we would be able to support at this time.."
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
Thank you very much for your detailed response. Unfortunately, I only understood about 20%, but I
will do some homework on the subject you described in such detail. The least I can do.