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

[amibroker] AFL buy and sell signals



PureBytes Links

Trading Reference Links









From:<font
size=2 face=Arial> <a
href="" target="_blank"
title="mailto:hvgistel@xxxxxxxxxxxxx";>Hans Veger

Date:<font
size=2 face=Arial> zondag 14
december 2003 17:56:50

<span lang=EN-GB
>To:<font
size=2 face=Arial> <font
size=2 face=Arial><a
href="" target="_blank"
title="mailto:amibroker@xxxxxxxxxxxxxxx";>amibroker@xxxxxxxxxxxxxxx<font
size=2 face=Arial>

<span lang=EN-GB
>Subject:<font
size=2 face=Arial> AFL
&#8211; buy and sell signals

 

<img border=0 width=32 height=32
id=contentbutton src="gif00627.gif" ><img border=0 width=32 height=32
id=attachbutton src="gif00627.gif" >



<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
  id=INCREDIMAINTABLE>
 
  
   <span
  lang=EN-GB >Hello<font
  face=Arial>
   
   <span
  lang=EN-GB >Can somebody help me
  with this???
   
   
  Im new for amibroker and I try to use the AFL in a
  trading system<span lang=EN-GB
  >
   
   
  I have seen a indicator as shown below in:<font
  face=Arial>
   
  <a
  href="" target="_blank"
  title="http://www.amibroker.com/members/traders/01-2004.html";><span
  lang=EN-GB >http://www.amibroker.com/members/traders/01-2004.html<font
  face=Arial>
   
   
  Please could you help me to make the AFL compatible
  for realtime
  trading with for example QQQ and
  BRCD.<font
  face=Arial>
   
  At this moment I can see the results but there are<font
  face="Times New Roman"> no<font
  size=2 face=Arial>
  buy or sell signals ( arrows in green and red ) visible?<font
  face=Arial>
   
  Thanks in advance for your help.<font
  face=Arial>
   
  With kind regards<span
  lang=EN-GB >
   
  <font
   size=2 face=Arial>Hans
   Veger<span lang=EN-GB
  >
  <font
    size=2 face=Arial>Netherlands<font
  face=Arial>
   
  <a href="" target="_blank"
  title="mailto:hvgistel@xxxxxxxxxx";><span lang=EN-GB
  >hvgistel@xxxxxxxxxx<font
  face=Arial>
   
   
   
   
   
   
  //--Indicator-End--
  // Above line instructs the parser that
  the code
  // below is only for
  commentary/interpretation window
  // This provides significant performance
  improvement
  //
  // (C)2002 amibroker.com
  movshort = MA(
  C, <span
  >Prefs(<span
  >4) );
  movmed = MA(
  C, <span
  >Prefs(<span
  >6) );
  movlong = MA(
  C, <span
  >Prefs(<span
  >28) );
  btop = BBandTop(
  C, <span
  >Prefs( <span
  >4 ), <span
  >Prefs(<span
  >8)/<span
  >100 );
  bbot = BBandBot(
  C, <span
  >Prefs(<span
  >4), <span
  >Prefs(<span
  >8)/<span
  >100 );
  width = btop - bbot;
  lslop = LinRegSlope(
  C, <span
  >30 ) + <span
  >100;
  lslo = LLV(
  lslop, 90 );
  lshi = HHV(
  lslop, 90 );
  lswidth = lshi - lslo;
  trend = 100*(
  lslop - lslo )/lswidth;
  mawidth = MA(
  width, 100 );
  relwidth = 100*(width
  - mawidth)/mawidth;
  _N<span
  lang=EN-GB >( tname = <font
  color=blue>Name()+<span
  >"("+<span
  >FullName()+<span
  >")" );
  Buy<font size=1
  face=Arial> = <span
  >Close < <span
  >Ref(C,-<font
  color=fuchsia>1) <span
  >AND <span
  >Ref(Close,-<font
  color=fuchsia>1) < <font
  color=blue>Ref(<span
  >Close,-<span
  >2) AND
  Ref(<span
  >Close,-<span
  >2) < <span
  >Ref(Close,-<font
  color=fuchsia>3)<span
  >AND <span
  >Ref(Close,-<font
  color=fuchsia>3) < <font
  color=blue>Ref(<span
  >Close,-<span
  >4) AND
  Ref(<span
  >Close,-<span
  >4) < <span
  >Ref(Close,-<font
  color=fuchsia>5) ; 
  Sell<font size=1
  face=Arial> = 
  Close<font size=1
  face=Arial> > <font
  color=blue>Ref(<span
  >C,-<span
  >1) AND
  Ref(<span
  >Close,-<span
  >1) > <span
  >Ref(Close,-<font
  color=fuchsia>2) <span
  >AND <span
  >Ref(Close,-<font
  color=fuchsia>2) > <font
  color=blue>Ref(<span
  >Close,-<span
  >3)AND
  Ref(<span
  >Close,-<span
  >3) > <span
  >Ref(Close,-<font
  color=fuchsia>4) <span
  >AND <span
  >Ref(Close,-<font
  color=fuchsia>4) > <font
  color=blue>Ref(<span
  >Close,-<span
  >5) ; 
   
  "Price and moving averages:"<font
  size=1 face=Arial>;
  tname + "
  has closed " + WriteIf(
  C > movshort, <font
  color=fuchsia>"above" , <font
  color=fuchsia>"below" ) +
  " its short time moving
  average. ";
  "Short time moving average is
  currently "<span lang=EN-GB
  > + <span
  >WriteIf( movshort > movmed, <font
  color=fuchsia>"above", <font
  color=fuchsia>"below") + <font
  color=fuchsia>" mid-time, and "
  + WriteIf( movshort
  > movlong, "above",
  "below"
  ) + " long time moving
  averages.";
  "The relationship between price
  and moving averages is: "<span
  lang=EN-GB >+
  WriteIf<span
  lang=EN-GB >( <span
  >C > movshort <span
  >AND movshort > movmed, <font
  color=fuchsia>"bullish",
  WriteIf<span
  lang=EN-GB >( <span
  >C < movshort <span
  >AND movshort < movmed, <font
  color=fuchsia>"bearish", <font
  color=fuchsia>"neutral" )
  ) + " in short-term, and
  "+
  WriteIf<span
  lang=EN-GB >( movshort > movmed <span
  >AND movmed > movlong , <font
  color=fuchsia>"bullish",
  WriteIf<span
  lang=EN-GB >( movshort < movmed <span
  >AND movmed < movlong, <font
  color=fuchsia>"bearish", <font
  color=fuchsia>"neutral" )
  ) + " in mid-long term. ";
  "\nBollinger Bands:"<font
  size=1 face=Arial>;
  tname+ "
  has closed " + 
  WriteIf<span
  lang=EN-GB >( <span
  >C < bbot, <span
  >"below the lower band by " +
  WriteVal<span
  lang=EN-GB >( <span
  >100 *( bbot-C )/ width, 1.1
  ) + "%. "
  +
  WriteIf<span
  lang=EN-GB >( trend < <font
  color=fuchsia>30, <font
  color=fuchsia>" This combined with the steep
  downtrend can suggest that the downward trend in prices has a good chance of
  continuing. However, a short-term pull-back inside the bands is likely.",
  WriteIf<span
  lang=EN-GB >( trend > <font
  color=fuchsia>30 <span
  >AND trend < <span
  >70, <span
  >"Although prices have broken the lower band and a
  downside breakout is possible, the most likely scenario for "+tname+<font
  color=fuchsia>" is to continue within
  current trading range.", <span
  >"" ) ), <span
  >"" ) +
  WriteIf<span
  lang=EN-GB >( <span
  >C > btop, <span
  >"above the upper band by " +
  WriteVal<span
  lang=EN-GB >( <span
  >100 *( C-
  btop )/ width, 1.1
  ) + "%. "
  +
  WriteIf<span
  lang=EN-GB >( trend > <font
  color=fuchsia>70, <font
  color=fuchsia>" This combined with the steep
  uptrend suggests that the upward trend in prices has a good chance of
  continuing. However, a short-term pull-back inside the bands is likely.",
  WriteIf<span
  lang=EN-GB >( trend > <font
  color=fuchsia>30 <span
  >AND trend < <span
  >70, <span
  >"Although prices have broken the upper band and a
  upside breakout is possible, the most likely scenario for "+tname+<font
  color=fuchsia>" is to continue within
  current trading range.", <span
  >"" ) ), <span
  >"" ) +
  WriteIf<span
  lang=EN-GB >( <span
  >C < btop AND ( ( btop - C
  ) / width ) < 0.5,
  
  "below upper band by "<font
  size=1 face=Arial>
  +
  WriteVal<span
  lang=EN-GB >( <span
  >100 *( btop - C )/ width, 1.1
  ) + "%. ",
  
  WriteIf<span
  lang=EN-GB >( <span
  >C < btop AND C > bbot
  , "above bottom band by
  " +
  WriteVal<span
  lang=EN-GB >( <span
  >100 *( C
  - bbot )/ width, 1.1
  ) + "%. ",
  "" )
  );
  WriteIf<span
  lang=EN-GB >( ( trend > <font
  color=fuchsia>30 <span
  >AND trend < <span
  >70 AND
  ( C > btop <span
  >OR C
  < bbot ) ) AND <font
  color=blue>abs(relwidth) > <font
  color=fuchsia>40,
  "This picture becomes somewhat
  unclear due to the fact that Bollinger Bands are currently"<font
  size=1 face=Arial>,
  "Bollinger Bands are "<font
  size=1 face=Arial>
  )+ 
  WriteVal<span
  lang=EN-GB >( <span
  >abs( relwidth ), <span
  >1.1 ) + <span
  >"% " +
  WriteIf<span
  lang=EN-GB >( relwidth > <font
  color=fuchsia>0, <font
  color=fuchsia>"wider" , <font
  color=fuchsia>"narrower"
  ) +
  " than normal."<font
  size=1 face=Arial>;
  WriteIf<span
  lang=EN-GB >( <span
  >abs( relwidth ) < <span
  >40, <span
  >"The current width of the bands (alone) does not
  suggest anything conclusive about the future volatility or movement of
  prices.","")+
  WriteIf<span
  lang=EN-GB >( relwidth < -<font
  color=fuchsia>40, <font
  color=fuchsia>"The narrow width of the bands
  suggests low volatility as compared to " + tname + <font
  color=fuchsia>"'s normal range. Therefore,
  the probability of volatility increasing with a sharp price move has
  increased for the near-term. "+
  "The bands have been in this
  narrow range for "<span
  lang=EN-GB > + <span
  >WriteVal(<span
  >BarsSince(<span
  >Cross(-<span
  >40,relwidth)),<span
  >1.0) + <span
  >" bars. The probability of a significant price
  move increases the longer the bands remain in this narrow range."
  ,"")+
  WriteIf<span
  lang=EN-GB >( relwidth > <font
  color=fuchsia>40, <font
  color=fuchsia>"The large width of the bands
  suggest high volatility as compared to " + tname + <font
  color=fuchsia>"'s normal range. Therefore,
  the probability of volatility decreasing and prices entering (or remaining
  in) a trading range has increased for the near-term. "+
  "The bands have been in this wide
  range for "<span lang=EN-GB
  > + <span
  >WriteVal(<span
  >BarsSince(<span
  >Cross(relwidth,<span
  >40)),<span
  >1.0) + <span
  >" bars.The probability of prices consolidating
  into a less volatile trading range increases the longer the bands remain in
  this wide range." ,<span
  >"");
  Buy<font size=1
  face=Arial>=<font
  color=blue>Cross(<span
  >MACD(), <span
  >Signal());
  Sell<font size=1
  face=Arial>=<font
  color=blue>Cross(<span
  >Signal(), <span
  >MACD());
  shape = Buy *
  shapeUpArrow + <span
  >Sell * shapeDownArrow;
  Plot<span
  lang=EN-GB >( <span
  >Close, <span
  >"Price", <span
  >colorBlue
  , styleCandle
  );
  PlotShapes<font size=1
  face=Arial>(
  shape, IIf( <span
  >Buy, colorGreen,
  colorRed ), <span
  >0, <span
  >IIf( Buy,
  Low, High ) );
  GraphXSpace<font
  size=1 face=Arial>
  = 5;
  Y=5;
  X=5;
  ApplyStop<span
  lang=EN-GB >( <span
  >0, <span
  >1, Y, <span
  >1 ); <span
  >// max loss stop y%
  ApplyStop<span
  lang=EN-GB >( <span
  >1, <span
  >1, X, <span
  >1 ); <span
  >// profit target stop x%
  five_days_down = IIf(<span
  >Close < <span
  >Ref(Close,
  -1) <span
  >AND
  (Ref(<span
  >Close, -<span
  >1) < <span
  >Ref(Close,
  -2)) <span
  >AND
  (Ref(<span
  >Close, -<span
  >2) < <span
  >Ref(Close,
  -3)) <span
  >AND
  (Ref(<span
  >Close, -<span
  >3) < <span
  >Ref(Close,
  -4)) <span
  >AND
  (Ref(<span
  >Close, -<span
  >4) < <span
  >Ref(Close,
  -5)), <font
  color=fuchsia>1, <font
  color=fuchsia>0);
  five_days_up = IIf(<span
  >Close > <span
  >Ref(Close,
  -1) <span
  >AND
  (Ref(<span
  >Close, -<span
  >1) > <span
  >Ref(Close,
  -2)) <span
  >AND
  (Ref(<span
  >Close, -<span
  >2) > <span
  >Ref(Close,
  -3)) <span
  >AND
  (Ref(<span
  >Close, -<span
  >3) > <span
  >Ref(Close,
  -4)) <span
  >AND
  (Ref(<span
  >Close, -<span
  >4) > <span
  >Ref(Close,
  -5)), <font
  color=fuchsia>1, <font
  color=fuchsia>0);
  Buy<font size=1
  face=Arial> =
  five_days_down;
  Sell<font size=1
  face=Arial> =
  five_days_up; 
  Buy<font size=1
  face=Arial> = <font
  color=blue>Sum( <span
  >ROC( Close,
  1 ) > <font
  color=fuchsia>0, <font
  color=fuchsia>5 ) == <font
  color=fuchsia>5;
  Sell<font size=1
  face=Arial> = <font
  color=blue>Sum( <span
  >ROC( Close,
  1 ) < <font
  color=fuchsia>0, <font
  color=fuchsia>5 ) == <font
  color=fuchsia>5;
  Buy<font size=1
  face=Arial> = <span
  >High == <span
  >LastValue( <span
  >Highest( High
  ) ); 
  Buy<font size=1
  face=Arial> = <span
  >High == <span
  >HHV( High,
  20 ) <span
  >AND <span
  >Ref( <span
  >HHVBars( High,
  20 ), -<font
  color=fuchsia>1 ) >=<font
  color=fuchsia>4; 
  Buy<font size=1
  face=Arial> = <font
  color=blue>Cross( <span
  >MACD(), <span
  >0 ); 
  Sell<font size=1
  face=Arial> = <font
  color=blue>Cross( <span
  >0, <span
  >MACD() );
  Buy<font size=1
  face=Arial> = <font
  color=blue>Cross( <span
  >EMA( Close,
  9 ), <font
  color=blue>EMA( <span
  >Close, <span
  >15 ) ); 
  Sell<font size=1
  face=Arial> = <font
  color=blue>Cross( <span
  >EMA( Close,
  15 ), <font
  color=blue>EMA( <span
  >Close, <span
  >9 ) );
  Buy<font size=1
  face=Arial> = <font
  color=blue>Cross( <span
  >RSI(), <span
  >30 );
  Sell<font size=1
  face=Arial> = <font
  color=blue>Cross( <span
  >70, <span
  >RSI() );
  Buy<font size=1
  face=Arial> = <font
  color=blue>Cross( <span
  >Ultimate(), <span
  >50 );
   
   
  
  
  
<font size=2
  face="Courier New">Send BUG REPORTS
  to bugs@xxxxxxxxxxxxx<span
  lang=EN-GB >
  Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
  -----------------------------------------
  Post AmiQuote-related messages ONLY to:
  amiquote@xxxxxxxxxxxxxxx 
  (Web page: <font
  size=2 face="Courier New"><a
  href="" target="_blank"
  title="http://groups.yahoo.com/group/amiquote/messages/)">http://groups.yahoo.com/group/amiquote/messages/)<font
  size=2 face="Courier New">
  --------------------------------------------
  Check group FAQ at: <font
  size=2 face="Courier New"><a
  href=""
  target="_blank"
  title="http://groups.yahoo.com/group/amibroker/files/groupfaq.html";><span
  lang=EN-GB>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<font
  face=Arial> 
  
  <span lang=EN-GB
  >Your use of Yahoo! <font
  size=2 face="Courier New">Groups is subject to
  the <a href="" target="_blank"
  title="http://docs.yahoo.com/info/terms/";>Yahoo! Terms of Service.<font
  face=Arial> 
   
  
 
 
  <td width="100%" 
  id=INCREDIFOOTER>
  <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
   >
   
    
    <span
    > 
    
    
    <font size=3
    face="Times New Roman"> 
    
    
    <font size=3
    face="Times New Roman"> 
    
   
  
  <span
  >
  
 


 










Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




Attachment: Description: ""