Gordon,
 
You cannot compare a stochastic to a MA of the close.
StochKRising=StochK(5)>MA(C,10);
They are two seperate things.
Perhaps more along the lines of
StochKRising=StochK(5)>Ref(StochK(5),-1); // Compare the current stochastic
to what it was one bar ago. (-1)


Regards, 

Neil Wrightson. 



  _____  

From: [email protected] [mailto:[email protected]] On Behalf
Of Gordon
Sent: Tuesday, 29 December 2009 5:30 PM
To: [email protected]
Subject: [amibroker] Coding trouble


  

This is my first attempt to code and it does not work. Need assistance.

I want to run an exploration to produce a report lisiting every member of a
watchlist where both todays Stochastic %K and the Signal line (MACD)are in
uptrends.

The AFL editor sees no trouble with the coding but as I get nil results I
suspect the code is defective.

I would also like to add another factor - Stochastics must be below -25 
but I gave up when the basic part did not work

StochKRising=StochK(5)>MA(C,10);
SignalRising=(Signal(5)>MA(C,10));

Filter=StochKRising AND SignalRising;

AddColumn(StochK(5),"StochK",1.2);
AddColumn(MA(C,10),"MA(C,10)",1.2);
AddColumn(Signal(5),"Signal",1.0);
AddColumn(MA(V,10),"MA(V,10)",1.0);

Any help would be appreciated




Reply via email to