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

Re: [amibroker] Buy and Sell price



PureBytes Links

Trading Reference Links

Tomasz:

As an example for both long and short postions.


Buyprice=Fractalup+0.065;
Sellprice=AlligatorGreen;

shortprice = FractalDown-0.065;
coverprice = AlligatorGreen;

Buy=Cross(H,Buyprice) and ( (Hope and Cry)==0 );
Sell=Cross(SellPrice,L);
Short=Cross(L,ShortPrice) and ( ( Hope and Cry)==0);
Cover=Cross(H,Coverprice);

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

I think this works as well.

Steve

At 05:56 PM 5/20/01 +0200, you wrote:

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.