PureBytes Links
Trading Reference Links
|
1) Instead of "for" loop use IIF(), it's easier:
http://www.amibroker.com/guide/afl/afl_view.php?id=72
2) Use PlotShapes() to plot dots, arrows, etc. on the chart:
http://www.amibroker.com/guide/afl/afl_view.php?id=206
Your code should look something like this:
dotlocationLong = L - 3;
dotlocationShort = H + 3;
// specify variables
PivotMALong = ??;
PivotMAShort = ??;
IIF( ... your conditions here ... );
// plot the main chart
Plot( Close, "", colorBlue, styleCandle );
// plot your shapes
PlotShapes( ... );
/////
Below is an example of the code for PlotShapes. This is just one possible method, there are a few different ways of coding this:
//***START ***//
Title = Name()+" \\c11"+Interval(format=2)+" "+Date()+"\\c-1 C="+C+"\\c11 "+FullName();
Plot(C,"",colorBlue, styleCandle);
Plot(EMA(C,14), "", 32, 1);
Buy =Cross(C, EMA(C,14));
Sell=Cross(EMA(C,14), C);
PlotShapes(shapeUpArrow * Buy, colorGreen, 0, L, -15);
PlotShapes(shapeDownArrow * Sell, colorRed, 0, H, -15);
SetChartOptions(0, chartShowDates); // show Date on X-axis
// to prevent your shapes to move beyond the
// top/bottom of the chart use this:
GraphXSpace = 5;
//***END ***//
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/
|