Two things... you haven't defined AdvDecEMA before you've referenced
it... i.e. you try & define it and reference it at the same time.
Can't be done... second, you have a bracket missing from the end of
the offending line...

try this,

AdvDecEMA = 0;
PastWeight = Param("Past Data Weight", 0.1, 0.1, 2, 0.1);
NewWeight = Param("New Data Weight", 0.9, 0.1, 2, 0.1);
AdvDecEMA = (NewWeight * Ref(AdvDecEMA, -1) + PastWeight *
(AdvIssues() - DecIssues()));

Plot(AdvDecEMA, "McMillian Adv/Dec", colorBlue, style = styleLine,
Null, Null, Null);

However, you will need to investigate the results of this... since you
recursively reference an array. Which I'm not 100% sure about.
Double check results... you may get something weird.

--- In [email protected], Conrad Smith <conradfsmi...@...> wrote:
>
> Hi guys, 
> 
> In the following custom indicator, I reference a day back but, for
reasons that I hope are obvious to you, it throws an error.
> 
> The indicator:
> 
> PastWeight = Param("Past Data Weight", 0.1, 0.1, 2, 0.1);
> NewWeight = Param("New Data Weight", 0.9, 0.1, 2, 0.1);
> AdvDecEMA = (NewWeight * Ref(AdvDecEMA, -1) + PastWeight *
(AdvIssues() - DecIssues());
> 
> Plot(AdvDecEMA, "McMillian Adv/Dec", colorBlue, style = styleLine,
Null, Null, Null);
> 
> I've colored the problem bit in red.
> 
> Any help would be most appreciated!
> 
> Thanks,
> Conrad
>


Reply via email to