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

Re: [amibroker] Help needed for AFL



PureBytes Links

Trading Reference Links

Hello,

>From the code you posted it looks like you are after existing after N-bars since entry.
If so, this is one liner applystop

ApplyStop( stopTypeNBar, stopModeBars, nBarExit, 1 ); 

As to the error, you need to read common mistakes docs:
http://www.amibroker.com/guide/a_mistakes.html#IFELSE


Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "vishy_sharma" <vishy_sharma@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, February 11, 2008 4:28 PM
Subject: [amibroker] Help needed for AFL


> Hi,
> I am writing my first AFL system and as such encountered few 
> stumbling blocks. If someone can help to clear my roadblocks I will 
> be very grateful.
> 
> I have lines of code -
> // here I am trying to find the how many bars I am in trade
> // I can only be in long or short at one time.
> barsSinceEntry = Min(BarsSince(Buy),BarsSince(Short));
> if (barsSinceEntry == nBarExit){
>  // other code here
> }
> 
> It gives me an error saying -
> Condition in IF, WHILE, FOR statements has to be Numeric or Boolean 
> type. You can not use array here, please use [] (array subscript 
> operator) to access array elements
> 
> I tried using barsSinceEntry[0]. It passes syntax but there isnt any 
> value in barsSinceEntry[0].
> 
> Please help.
> 
> vishal
> 
> 
> 
> 
> 
> 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
> 
> Yahoo! Groups Links
> 
> 
> 


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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/