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

Re: [amibroker] How to specify a different buy price than C,O,H,L, AV in Backtester AFL code?


  • Date: Thu, 21 Jan 2010 08:17:58 -0700
  • From: Howard B <howardbandy@xxxxxxxxx>
  • Subject: Re: [amibroker] How to specify a different buy price than C,O,H,L, AV in Backtester AFL code?

PureBytes Links

Trading Reference Links



Hi Nugget --

Try this:

//    BuyAtANewHigh.afl
//
//    Buy if today's high is at least 1% higher than yesterday's high


TargetPrice = 1.01 * Ref( H, -1 );
Buy = H > TargetPrice;
BuyPrice = TargetPrice;
Sell = BarsSince( Buy ) >= 2;

///////////////////////////


Thanks,
Howard


On Thu, Jan 14, 2010 at 6:10 PM, nuggettrader <matti.vataja@xxxxxxxxx> wrote:
 

I need to know how to specify a different buy price than C,O,H,L,AV in Backtester AFL code. I use TeleChart end of day data. For example I want to buy if and when a stock tops yesterday's High by 1%. In other words if today's High is at least 1% higher than yesterday's High then I would get a buy signal at some time during the trading day regardless if the stock closes 1% or more higher or not. How do I code this in AFL?




__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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





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

__,_._,___