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

RE: [amibroker] Simple code is not working,,,



PureBytes Links

Trading Reference Links

Hello,

 

MinChange = 3.0;

Buy = ROC(C,1)<-MinChange;

Sell = ROC(C,1)>MinChange;

Best Regards
Thomas
www.PatternExplorer.com
support@xxxxxxxxxxxxxxxxxxx

  _____  

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of chugunok
Sent: Wednesday, December 20, 2006 10:13 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Simple code is not working,,,

 

Hi Folks,
I am learning AFL, and tried to implement a simple strategy:
Buy when price drops 3% below yesterday's close
Sell when it is 3% above the purchase price

Here is the code:

BuySignal = ( Close - Ref(Close, -1) ) / Close;
SellSignal = (Close-BuyPrice) / Close;
Buy = BuySignal < -0.03;
Sell = SellSignal > 0.03;

When I run it in scan I only get Buy signals, no sell signals. I
assume there is a problem with the logic, but I cannot see it...
I would appreciate a helping hand :-)
Thanks, Paul C.

 


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.26/594 - Release Date: 12/20/2006 3:54 PM