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

Re: [amibroker] Types of orders



PureBytes Links

Trading Reference Links

Jack,

I am a relatively new user of Amibroker (so I may be corrected by others)

> - exiting a trade (long or short) after N days?

if your buy signal is event driven such as the as the default
"buy = cross( macd(), 0 );" then you can use the REF function to test for
the occurrence of event N days ago.

> - exiting a trade (long or short) when a certain price is reached?

you can hard code a price into the selling condition, for example
"sell =(h==2.50);" Is this what you mean?

> - exiting a trade (long or short) after achieving X % profit? (or
> losing $Y)?

use the stop loss box to cater for percentage loss sell signals. This does
not allow for negative values so you can't use it to simulate a sell signal
on
reaching X% profit.

I presume that variable values do not persist from one day to the next,
otherwise you could use
something like
buy = cross( macd(), 0 );
iif (buy == 1,buyprice = c,buyprice=buyprice);
sell = (c>buyprice * 1.1);
iif (sell == 1,buyprice = 0,buyprice=buyprice);


Regards
Richard



----- Original Message -----
From: <jacklweinberg@xxxx>
To: <amibroker@xxxxxxxxxxx>
Sent: Wednesday, October 04, 2000 5:46 AM
Subject: [amibroker] Types of orders


> Hello:
> Is it possible in AMIBROKER (AFL) to simulate:
> - exiting a trade (long or short) after N days?
> - exiting a trade (long or short) when a certain price is reached?
> - exiting a trade (long or short) after achieving X % profit? (or
> losing $Y)?
> Thanks.
> It appears to be a great product.
> If it can do those things as described above, I hope that I can
> volunteer to learn and write AFL code to simulate Technical Analysis
> of Stocks and Commodities indicators and systems.
>
>
>
>
>