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

[amibroker] Re: Multiple IIF statements



PureBytes Links

Trading Reference Links




I had the same problem. A solution is the following:

BuyState[0] = 0; //Initialize before you use them.
ShortState[0] = 0; //You’ll probably want to access them within your Buy/Sell statements or maybe sooner.

//Your code

Buy = ??;
Sell = ??;
Short = ??;
Cover = ??;

BuyState = Flip(Buy,Short);
ShortState = Flip(Short,Buy);

Regards,

Terry
--

I am trying to do a 'Addcolumn' in Explore that will show a 1 every 
day the Buy is in effect rather than a 1 just on the day it becomes a 
Buy.

I can do it in Excel by using several 'If' statements. 
In Amibroker my 'Newbuy' column would be something like;
IIF(Buy,IIf(Sell,IIf(Ref(Buy,1),1,0)));

Thanks for your help, Joe
 



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

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 


Yahoo! Groups Sponsor 
 
 ADVERTISEMENT
 <http://us.ard.yahoo.com/SIG=129no1tno/M=295196.4901138.6071305.3001176/D=groups/S=1705632198:HM/EXP=1090947470/A=2128215/R=0/SIG=10se96mf6/*http://companion.yahoo.com>  

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 <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe> 
 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . 



-- 
Terry




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

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Sponsor


  ADVERTISEMENT 












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 the Yahoo! Terms of Service.