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

Re: [amibroker] can somebody help me set a real time scan up



PureBytes Links

Trading Reference Links

Is there any way to incorporate Commissions in the back tester based 
on the length of time a position is held? Some mutual funds I trade 
have a minimum holding period.
For example how could the following code be modified:

BUY = ...my Buy signal;

sellCond1 = BarsSince(Buy) > 21; // Minimum 21 day holding period 
sellCond2 = ...my stop loss condition;
Sell = (...my Sell Condition AND sellCond1) OR
        sellCond2;

SellPrice = iif(sellCond1,Close,Close-Close * 0.075);//This doesn't 
work

SellPrice doesn't work because mutual funds have no OHL prices and 
AmiBroker fills these arrays with the Close--- O=H=L=C---, so the 
backtester adjusts SellPrice to the close.

Any hints appreciated.

dale b


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/amibroker/

To unsubscribe from this group, send an email to:
 amibroker-unsubscribe@xxxxxxxxxxxxxxx

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/