How would one go about transcribing this piece of EasyLanguage code into Lite-C? I have tried a few things with series, however, I am getting an "Undeclared Identifier" error.
EasyLanguage:
Vars: MySeries(0);
MySeries = MySeries[1] + MySeries[2];
Lite-C Attempt:
vars MySeries = series(MySeries[1] + MySeries[2]);
I don't think that this works in any language. If you want a series, first make up your mind what this series shall contain. Only when you know that, you can add up elements.
I realized how to reframe my question. In Zorro, there are Finite Impulse Response (FIR) Filters. I want to find a way to write Infinite Impulse Response (IIR) Filters, or recursive filters. These types rely on their past outputs to calculate current values. Programmatically, I’ve seen this done in EasyLanguage. However, in terms of Lite-C, how would one go about writing a IIR Filter? I know JCL would probably know because this is a DSP question.
Thank you again for any assistance!
Also, thnx Hredot, that was one of the things I tried. I will try it again, maybe I made a mistake.
An internal counter determines the pointer to be returned by a series() call. Therefore, series can only be created in the run function or in a function that is called from the run function; and they must be always created in the same order. Thus series calls must not depend on if or any other condition that can change from bar to bar (see example below). These requirements also apply to all functions that internally create series, such as some indicator or signal processing functions. Zorro detects wrong series calls and will display an error message in this case.
In fact, you are assigning two different series to the same vars. This is pointless.
Also, it's not really clear what you are trying to do.
If you are familiar with the work of John Ehlers, he tends to utilize IIR filters. I am simply trying to create an IIR filter, or a filter that has an output dependent upon past outputs. I know it kind of sounds like a paradox, however, I know it is a very common concept in DSP. Thank you for this advise, I will try this without a global series.
EDIT: Perhaps, to be ultra clear. Here is the literal code from the book in EasyLanguage format. I am not quite sure what to make of the "currentbar", I haven't wrapped my head around what would be similar in Lite-C. This code works as EasyLanguage in TradeStation 9.5. BTW, it is a really cool indicator, when it is working properly. It is able to detect the turning points in price quite quickly. (See attachment)
Nice, man! Thank you so much. This seems to be more like its behavior. The only thing it is lacking is that smoothing for the "currentbar < 7" rule, I think. Forgive the novice, eh? Also, enjoy! Note: Try playing with the alpha variable. A value of 0.5 makes it a bit more pointed.
I can tell by reading it that it is designed for when you are at a super-low lookback period, as it does not account for alpha.
So you should ignore that since you already have 200 lookback.
I still have an Ehlers book on my shelf that I need to read. I will need all of its juicy context before I start playing around with these types of code.