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

Re: [amibroker] Buy and Sell price



PureBytes Links

Trading Reference Links

Hi,

Wow, you are really great, basically your formula is OK.

I will explain new AFL features in the newsletter but now just a couple of
main things:

So you can write the following to simulate real stop-orders:

Buyprice=Fractalup+0.065;
Sellprice=AlligatorGreen;

// if anytime during the day prices rise above buyprice level (high>buyprice) 
// the buy order takes place (at buyprice)
Buy=Cross(High,Buyprice); 

// if anytime during the day prices fall below sellprice level ( low < sellprice )
// the sell order takes place (at sellprice)
Sell=Cross(SellPrice,Low);

You can also control trade price:
buyprice = IIF( dayofweek() == 1, HIGH, CLOSE ); // on monday buy at high, otherwise buy on close

====================
Short trade support.
>From version 3.59 you need to assign short and cover variables to back-test short trades.
If you use stop-and-reverse system (always on the market) simply assign sell to short and buy to cover

short = sell;
cover = buy;

This was how pre-3.59 versions worked.
But now you can have separate trading rules for going long and for going short:

// long trades entry and exit rules:
buy = cross( cci(), 100 );
sell = cross( 100, cci() );

// short trades entry and exit rules:
short = cross( -100, cci() );
cover = cross( cci(), -100 );

Note that in this example if CCI is between -100 and 100 you are out of the market.

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com

----- Original Message ----- 
From: "Steve Wiser" <slwiserr@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, May 20, 2001 4:53 PM
Subject: [amibroker] Buy and Sell price


> Tomasz:
> 
> I think I have these figured out. This is what I did. Is this correct?
> 
> Buyprice=Fractalup+0.065;
> Sellprice=AlligatorGreen;
> 
> Buy=Cross(C,Buyprice);
> Sell=Cross(SellPrice,C);
> 
> Does the Buy or Sell take place at the price or at the C? I am thinking it 
> is at the price.
> 
> Thanks again.
> 
> Steve
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
>