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

[amibroker] exploration bug or programming error???



PureBytes Links

Trading Reference Links

Hi Seniors,

I am trying to develop an exploration using a collection of indicators but somehow the exploration is gving wrong signal. While the indicator values shows correct positive/negative values, the signal remains buy. Even for many indicators the colour changes to red/green but somehow the signal (thru writeif) gves wrong indication.

Anybody pls help.....since it contains too many indicators , i am pasting code of one of indicators using macd crossover... pls check my writeif for buy which is gving error.

PS: do we need to set the variables to null at the end so that the cache is not carrying over a wrong signal for the next day? but if it does then how come the colour of column is changing correctly? where is the bug?

//macd crossover

p = Param("P",12,3,36,2);

q = Param("Q",26,3,52,2);

r = Param("R",9,3,15,1);

EMA1= EMA(Close,p);

EMA2= EMA(EMA1,p);

Difference= EMA1 - EMA2;

ZeroLagEMAp= EMA1 + Difference;

EMA1= EMA(Close,q);

EMA2= EMA(EMA1,q);

Difference= EMA1 - EMA2;

ZeroLagEMAq= EMA1 + Difference;

ZeroLagMACD=ZeroLagEMAp - ZeroLagEMAq;

EMA1= EMA(ZeroLagMACD,r);

EMA2= EMA(EMA1,r);

Difference= EMA1 - EMA2;

ZeroLagTRIG= EMA1 + Difference;

//buy signal till macd is abv signal

spmacd_buy=zerolagmacd>zerolagtrig;

spmacd_val= WriteIf((zerolagmacd-zerolagtrig>0), "Buy", "Sell");// error...remains buy always

// Set the background color for Sp MACD Sgnal Status Column

spMACD_Col=IIf(spmacd_buy,colorGreen,colorRed);

Filter = 1;

AddTextColumn(Spmacd_val, "SpMACD", 1, colorWhite, Spmacd_Col);

// end

 

Thsnks

 

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___