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

Re: [amibroker] referencing last exit price & trade outcome



PureBytes Links

Trading Reference Links

Try this:

exitprice = valuewhen(Sell,SellPrice,1);
cond_a = C > exitprice;
cond_b = exitprice > valuewhen(Buy,BuyPrice,1);

I believe this will work, not including commissions. Note that Short and 
Cover would be a variation of the above.

There's probably a better way in 4.70 with the new access to the backtester.

Terry

trader3600 wrote:

>
>
>I am new to Amibroker and need help with the following:
>
>1) how do I code these simple lines in AFL?
>
>(a)if current closing price > exit price of last trade
>
>(b) if previous trade was profitable or not
>
>thanks
>  
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/