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

Profit Taking?



PureBytes Links

Trading Reference Links

Hello!

I have a question about profit taking. Below is a piece of code 
written for profit taking (Message# 637)

3. Sell after achieving X% profit:

proftarget = 10; /* here you put percentage profit target */

buy = cross( macd(), 0 );
buyprice = valuewhen( buy, close );

sell = cross( 100*(close - buyprice)/buyprice, proftarget );


This works fine, if you plan to sell at the close of the day, not at 
the point (intraday) that the profit target was meet.

My question is this: Is there a way to have AmiBroker set the sell 
price at the profit level, instead of the close, high, low, etc. of 
the day? For example if I buy at the close when XYZ = 100, and 
profit level is 3%, I want to sell at 103. If the next day the high 
of the day was higher than 103 (say 105), but the close was 102, 
AmiBroker sells me at 102, NOT 103 (my intended profit taking level).

I hope I have not confused anyone with this question. Any help would 
be greatly apprciated! BTW, I love this software!!!

Regards,

Jared James
jjames@xxxx