Please always use the CODE button whenever posting code, thank you. Below
"Add new Post" there's a line with buttons Bold, Italic,
CODE etc. Click "CODE" and paste your code in between the tags.
QUOTE:
Up to line," DataSeries DEMA = ( S1 + ( S1 - S2 )) ;" I did not get any error message.
That's because to refer to DEMA the way you're doing, first it has to be "formalized" i.e. the Series method has to be implemented.
CODE:
Please log in to see this code.
No no, this doesn't make any sense - not the code, but the logic. DEMA has two
mandatory periods, you can't just arbitrarily define a DEMA(13) or DEMA(26) - you provide no explanation how would you do this!
As you might understand, ( D1 + ( D1 - D2 )) is always equal to D1 because D1 == D2.
In other words, your code is trying to turn a 2-parameter DEMA into a single-parameter: magically, without telling how exactly... which requires modification to DEMA formula... so it's no longer a DEMA but a different MA :)
Given that the logic/formula is not clear, to fix your code I have 2 suggestions:
1) Take some other applicable MA instead of DEMA - like SMA, EMA, SMMA, T3MA etc.
2) Use 2 sets of DEMA - one with the parameters 13,26, another with some different parameters. This is a valid use of DEMA.