[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Indicator Code not working after upgrade



PureBytes Links

Trading Reference Links

Prior to upgrading to version 4.3, the following code worked. Now I'm 
getting the error message ...

Unknown identifier at line 29, column 10:
Plot (RelRocOfPrice, "RelRoc of Price", barcolor, styleLog |
-----------------------------------------------------------^

BTW, this indicator code is placed in the builtin price indicator 
formula.

//Start of indicator code

Period = 107;

UpDay = C > Ref(C,-1);//define an up day
UpDays = Sum(UpDay, Period);//# of up days in the period
AvgUpRoc = MA(ROC(C,1) * UpDay,UpDays);//Average of the 1-day ROCs 
for up days over the lookback period
RelUpRoc = ROC(C,1) / Ref(AvgUpRoc,-1);//Today's 1-Day ROC compared 
to yesterday's AvgUpRoc
DnDay = C < Ref(C,-1);//define a down day
DnDays = Sum(DnDay, Period);//# of down days in the period
AvgDnRoc = MA(ROC(C,1) * DnDay,DnDays);//Average of the 1-day ROCs 
for down days over the lookback period
RelDnRoc = -(ROC(C,1) / Ref(AvgDnRoc,-1));//Today's 1-Day ROC 
compared to yesterday's AvgDnRoc

RelRocOfPrice = IIf(UpDay,RelUpRoc-1,RelDnRoc+1);

BarColor = IIf(UpDay, colorDarkGreen, IIf(DnDay, 
colorRed,colorBlack) );

Plot (RelRocOfPrice, "RelRoc of Price", barcolor, styleLog | 
styleOwnScale | styleHistogram); // THIS IS THE PROBLEM LINE

Plot(MA(RelRocOfPrice,3),"",colorLightBlue,styleHistogram  | 
styleThick | styleOwnScale);

//--Indicator-End--

If I remove the styleLog parameter from the problem line, the error 
message goes away, but the indicator no longer plots as a histogram. 
It plots all lines starting from the bottom of the pane. I have 
Logarithmic checked at the bottom of the indicator builder, as I want 
to price plotted using a logarithmic scale.

Can someone spot the problem? Help appreciated.

Tim Gadd




Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/