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

Re: [amibroker] Something is different. But what ?



PureBytes Links

Trading Reference Links

Is there more to the code?  Are you getting a syntax/initialization error?  How are you handling the case when i == 1?
 
Bill
 
----- Original Message -----
From: "amsiev" <ton.sieverding@xxxxxxxxxx>
Sent: Thursday, March 27, 2008 7:01 AM
Subject: [amibroker] Something is different. But what ?

> Why is following AFL statement :
>
> InLongPos = IIf(Buy==1,1000,IIf(Sell==1,0,Ref(InLongPos,-1)));
>
> giving me a different result as following ForLoop :
>
> for ( i=1; i<BarCount; i++ )
> {
> if (Buy[i]==1)
> InLongPos[i] = 1000;
> else
> {
> if (Sell[i]==1)
> InLongPos[i] = 0;
> else
> InLongPos[i] = InLongPos[i-1];
> }
> }
>
> The result I am getting from the ForLoop is correct. The first
> statement gives me a wrong answer. I want to get 1000 in InLongPos
> after Buy and before Sell ... When testing the statement in Excel
> it works fine with : =IF(A6=1;1000;IF(B6=1;0;C5)) ...
>
> What's wrong ?
>
>
> ------------------------------------
>
> 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/
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008 8:52 AM
>
>
__._,_.___

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




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___