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

[amibroker] syntax error help



PureBytes Links

Trading Reference Links

Hi Guys,

Sorry to do this so often but I'm having trouble working out the best 
way to do some Metatrader code conversion into AB and I'm getting a 
syntax error that my present coding level is having problems in working 
around.

MT4 Code:

    if (iSAR(NULL,0,0.02,0.2,1) >= High[1] &&
        iSAR(NULL,0,0.02,0.2,0) < Low[0] &&
        closeAll)

SAR of previous bar equal or greater than High of previous AND SAR of 
current bar is less than Low of current bar and the Boolean variable 
closeAll is True. Essentially, Sar was above and now below.

My Conversion to AB:

    if (Ref(SAR(0.02,0.2),-1) >= Ref(High,-1) &&
        SAR(0.02,0.2) < Low &&
        closeAll)

This gives me an Error 6. 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 know it's something stupid that I've not yet experienced and stored 
away yet so any help would be appreciated (as always).
Martin


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/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/