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

Re: [amibroker] Bars since Buy signal - how to code in AFL ?



PureBytes Links

Trading Reference Links

Paul,

I was getting around to an AFL equivelant...Thank you.

Buy = Cross( MACD(), Signal());

Sell=Cross(Signal(),MACD());

Long = Flip(Buy,Sell);

Days = IIf(Long,BarsSince(Buy),BarsSince(Sell));

Plot(C,"",colorBlack,styleCandle);

PlotShapes(Buy*shapeUpArrow,colorGreen);

PlotShapes(Sell*shapeDownArrow,colorRed);



Title=Name()+ WriteIf(Long," BarsSinceBuy [ "+WriteVal(Days,1)+ "]","BarssinceSell ["+WriteVal(Days,1)+ "]");


Anthony


  ----- Original Message ----- 
  From: Paul Chivers 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Sunday, October 31, 2004 8:11 PM
  Subject: Re: [amibroker] Bars since Buy signal - how to code in AFL ?


  Here's a shorter version without the loops.


  Buy = Cross( MACD(), Signal());
  Sell=Cross(Signal(),MACD());

  Long = Flip(Buy,Sell);

  Days = IIf(Long,BarsSince(Cross(Long,0.5)),0);

  Plot(C,"",colorBlack,styleCandle);

  PlotShapes(Buy*shapeUpArrow,colorGreen);

  Title=Name()+ " BarsSinceBuy [ "+WriteVal(Days,1)+ "]";




  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 
         
        Get unlimited calls to

        U.S./Canada
       
       


------------------------------------------------------------------------------
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/
      
    b.. To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/