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

Re: [amibroker] is AFL Stateless?



PureBytes Links

Trading Reference Links





Joe --
You're missing some 'false' results in your equations.  If you number
the IIf's in sequence you need to specify false1 and false2. ie.:
Newbuy = 
IIf(Buy,IIf(Sell,IIf(Ref(Buy,1),1,0),false2),false1);

Even so, my guess is that what you really want to do is this:
Newbuy =  IIf(Buy, 1,
            IIf(Sell, 0,
              IIf(Ref(Buy,1),1,0)
            )
          );

Pardon my "training wheels" but it makes it easier for me to see what
is really happening.  You can easily remove them if/when you don't need
them.

-- Keith

joeemmett2000 wrote:


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: <a
 href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
  
  
  






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.