Skip to main content

Collection and disposal of for Amibroker (AFL)

wwr over 12 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 9)
  • Tags:
    amibroker

Collection and disposal of

Indicator / Formula

Copy & Paste Friendly
 
AdjBar = Param("Bar",0,0,BarCount,1);
AdjZ = Param("Zig",2,0,20,.1);
//Select Current Tickers OHLC
CO = Ref(O,-AdjBar);
CH = Ref(H,-AdjBar);
CL = Ref(L,-AdjBar);
CC = Ref(C,-AdjBar);
//Select Foriegn OHLC
"Ticker " + TN = Name() ; // Show Ticker
"Index " + BI = GetBaseIndex(); //BI = BaseIndex String 
FO = Ref(Foreign( BI,"O"),-AdjBar);
FH = Ref(Foreign( BI,"H"),-AdjBar);
FL = Ref(Foreign( BI,"L"),-AdjBar);
FC = Ref(Foreign( BI,"C"),-AdjBar);
//Create Trend
ZAC = Zig( CC, AdjZ );
UTrend = ZAC > Ref(ZAC, -1);
DTrend = ZAC < Ref(ZAC, -1);
//Do Cross (Create Result Arrays)
t1 = OscP( 3, 6 );
Cond1a= Cross (t1,MACD());
Cond1b= MACD()>-1 AND MACD()<0;
Cond1= Cond1a AND Cond1b;
Cond2 = MACD()>Signal()-.5;
Cond3 = Cross(0,t1);
// Select Conditions to Display.
C1 = Ref(Cond1,-AdjBar);
C2 = Ref(Cond2,-AdjBar);
C3 = Ref(Cond3,-AdjBar);
ZColor = IIf(UTrend, colorAqua, colorCustom12);
Plot( ZAC, "school-stocks.com", ZColor, styleArea);
//Show Buy/Sell Arrows.
Buy = UTrend;
Sell= DTrend;
PlotShapes( shapeDownArrow * Sell, colorRed );
PlotShapes( shapeUpArrow * Buy, colorGreen );
_SECTION_BEGIN("exploration");
Filter=Close;
var = WriteIf(Buy,"buy",WriteIf(Sell,"sell",""));
AddTextColumn(var , "buy/sell", 1.2 , colorWhite, IIf( Buy, colorBlue,IIf(Sell,colorRed,colorWhite) )); 
_SECTION_END();
_SECTION_BEGIN("authorname");
GfxSelectFont("ARIAL", 12,800); 
GfxSetBkMode(1); 
GfxSetTextColor(colorWhite);
_SECTION_END();

4 comments

over 11 years ago

best for short term or who wish to earn real money in market
once again hats off to you

Leave Comment

Please login here to leave a comment.