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

[amibroker] Re: Need AFL help



PureBytes Links

Trading Reference Links

Thomas,

Use ValueWhen() method...

BuyPrice = IIf(Buy, H, ValueWhen(Buy, H, 1));

Hope this helps.

Jitu

--- In amibroker@xxxxxxxxxxxxxxx, "tchan95014" <tchan95014@xxxx> 
wrote:
> Hello,
> 
> I have an AFL question hoping that this great group can help.
> 
> The following example explains it.
> 
> Settradedelays(1, 1, 1, 1);
> Buy = ...
> Short = ...
> Sell = short;
> cover = buy;
> 
> Now, my question is on the buyprice/shortprice, since this is a 
> reversal system and they are symmetrical, I will use buy as the 
> example.
> 
> BUY   High of day   buyprice
> 0     40            --
> 0     45            --
> 1     50            50
> 0     45            50
> 1     40            40
> 0     35            40
> 0     30            40
> 0     25            40
> 1     20            20
> 0     15            20
> 1     25            * we have opened a long position here
> 
> As you can see, I need to keep the buyprice the same if there is NO 
> new buy signal comes up, and if there is no execution before that. 
If 
> a new buy signal comes up, then and only then the buyprice is 
> adjusted. Short end is the same just that High of day becomes Low 
of 
> day (here we are talking about signal day and to be executed the 
next 
> day if possible, an EOD system)
> 
> 
> Thanks for any helps...
> 
> 
> Thomas


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/I3w.vC/hP.FAA/3jkFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 

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