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

[amibroker] Re: Detecting an Open Position with AFL?



PureBytes Links

Trading Reference Links


What I need to do in AB/AFL is to check the current highs and lows 
against my current open position's buyprice while I'm still long.

So, based on the comparison between my buyprice and the high price 
for each bar, I will know whether my profit target has been hit.  
And, based on a similar comparison using the low, I will know if my 
sell-stop will have been triggered. 

I've had AB for about 3 weeks now and compared to TS, I am not 
as "up and running" with my system development as I was with TS/EL.  
But, I will continue to be patient.  Thanks.

--- In amibroker@xxxxxxxxxxxxxxx, "Fred" <ftonetti@xxxx> wrote:
> 
> I was a long time TS user prior to AB and getting used to AB/AFL 
> takes a little doing but is worth the ride.
> 
> Think of the array processor as executing your AFL statements ( 
> outside of the interior of your Do / For / While loops ) once and 
> only once as opposed to once per bar.
> 
> MOST things can be done without writing loops.
> 
> If you are simply looking as to whether a BUY is more current then 
a 
> SELL then ...
> 
> OnBuy = BarsSince(Buy) < BarsSince(Sell)
> 
> Will suffice ...
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "The Webmaster" 
> <maintainer_wiz@xxxx> wrote:
> > 
> > Is there a function to detect the open trading position of a bar?
> > 
> > I'm trying to use a for loop to check certain conditions which 
> would 
> > exit my long and go short.  However, it's not working because I 
> > think my coding assumptions about how this array programming 
thing 
> > works are incorrect.
> > 
> > If it's not already available, AB should add an AFL function or 
> > variable called Position which would return the open position of 
> the 
> > bar.  Just like in Trade Station's EasyLanguage.  AB has 
potential, 
> > but they should really look to Easy Language as a guide to 
> improving 
> > AFL.





------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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/