2 MACD - Daily Weekly - Amibroker AFL

| Friday, 15 March 2013

AFL for Amibroker

_SECTION_BEGIN("DW MASTER MACD");
 SetChartBkColor( ParamColor("Chart Color", colorBlack));
GraphXSpace = 10;
_SECTION_BEGIN("BACKGROUD LTRS");
SetChartOptions(0,chartShowArrows|chartShowDates);
GfxSetOverlayMode(1);
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ParamColor("Text Color", ColorHSB( 42, 42, 42 ) ));
GfxSetBkMode(0); // transparent
GfxSelectFont("Tahoma", Status("pxheight")/9 );
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/4.1 );
_SECTION_END();

k = (GetPerformanceCounter()/100)%256; 
printf("GetPerformance Counter %g",k);
GfxSelectFont("Arial Narrow", 10,700 ); 
GfxSetBkMode(1); 
GfxSetTextColor(colorYellow); 
//GfxTextOut("Dedicated to the loving memory of MY FATHER",100+k ,26); 
RequestTimedRefresh(1); 
_SECTION_END();

CellHeight = 19; 
CellWidth =100;
function PrintTrends( string, row, Col) 
{
GfxSetOverlayMode(0);
/* GfxRectangle( Col * CellWidth+100,ROW*CellHeight-55, (Col + 3 ) * CellWidth, 
(row +1 ) * CellHeight  -54); */
GfxDrawText( string, Col * CellWidth+180, 
                    row * CellHeight-54, 
                    (Col +3 ) * CellWidth, (row + 1 ) * CellHeight-54,0); 
}
GfxSetTextColor(ColorRGB(180,105,200));
TimeFrameSet( inWeekly );
StartBar=SelectedValue(BarIndex());
FinishBar = EndValue( BarIndex() );
i = Startbar;
HISTWEEK = MACD(12,26) - Signal(12,26,9);
todayHISTWEEK  = TimeFrameExpand(HISTWEEK  , inWeekly)  ; 
onedaybackHISTWEEK  =TimeFrameExpand( Ref(HISTWEEK ,-1)  , inWeekly) ;
twodaybackHISTWEEK  = TimeFrameExpand( Ref(HISTWEEK ,-2)  , inWeekly) ;
WEEKNEWTRENDUP = (todayHISTWEEK  [i] > onedaybackHISTWEEK  [i])   AND (onedaybackHISTWEEK  [i] <= twodaybackHISTWEEK [i]);
WEEKNEWTRENDDN = (todayHISTWEEK  [i] > onedaybackHISTWEEK [i])   AND (onedaybackHISTWEEK  [i] >= twodaybackHISTWEEK  [i]);
if( (todayHISTWEEK  [i] > onedaybackHISTWEEK  [i])   AND (onedaybackHISTWEEK  [i] <= twodaybackHISTWEEK [i]))
{
GfxSetTextColor(colorLime); 
//PrintTrends("New Trend Up",3,3); 
GfxTextOut("WEEKLY > New Trend Up",400,1.5 );
}
if( (todayHISTWEEK  [i] < onedaybackHISTWEEK [i])   AND (onedaybackHISTWEEK  [i] >= twodaybackHISTWEEK [i]) )
{
GfxSetTextColor(colorOrange); 
//PrintTrends("New Trend Down",3,3); 
GfxTextOut("WEEKLY > New Trend Down",400,1.5 ); 
}
if((todayHISTWEEK  [i] > onedaybackHISTWEEK [i])   AND (onedaybackHISTWEEK  [i] >= twodaybackHISTWEEK  [i])
)
{
GfxSetTextColor(colorLime); 
//PrintTrends("Trend Up",3,3); 
GfxTextOut("WEEKLY > Trend Up",400,1.5 ); 
}
if( (todayHISTWEEK  [i]< onedaybackHISTWEEK [i])   AND (onedaybackHISTWEEK  [i] <= twodaybackHISTWEEK  [i])
 )
{
GfxSetTextColor(colorOrange); 
//PrintTrends("Trend Down",3,3); 
GfxTextOut("WEEKLY > Trend Down",400,1.5 ); 
}
TimeFrameRestore();
Plot(TimeFrameExpand(HISTWEEK , inWeekly), "IFT_5m", colorOrange, styleThick);
TimeFrameSet(inDaily);
DMACD = MACD(12,26) - Signal(12,26,9);
mycolor=IIf(MACD(12,26)<0 AND MACD(12,26)>Signal(12,26,9),ColorRGB(48,170,255),IIf(MACD(12,26)>0 AND MACD(12,26)>Signal(12,26,9),ColorRGB(181,222,251),IIf(MACD(12,26)>0 AND MACD(12,26)<Signal(12,26,9),ColorRGB(255,201,123),ColorRGB(125,84,11))));
Plot(0,"",colorRed,styleThick);
MACD0crossup = Cross(MACD(12,26),Signal(12,26,9));
MACD0crossdw = Cross(Signal(12,26,9),MACD(12,26));
PlotShapes(shapeSmallCircle*MACD0crossup,colorLime,0,0.25,0);
PlotShapes(shapeSmallCircle*MACD0crossdw,colorPink,0,-0.25,0);
Plot(TimeFrameExpand(DMACD, inDaily), "dAILY", mycolor, styleHistogram);
TimeFrameRestore();
HISTDAILY = MACD(12,26) - Signal(12,26,9);
todayHISTDAILY  = HISTDAILY  ;
onedaybackHISTDAILY  = Ref(HISTDAILY ,-1);
twodaybackHISTDAILY  = Ref(HISTDAILY ,-2);
if( (todayHISTDAILY  [i] > onedaybackHISTDAILY  [i])   AND (onedaybackHISTDAILY  [i] <= twodaybackHISTDAILY [i]))
{
GfxSetTextColor(colorLime); 
//PrintTrends("New Trend Up",4,3); 
GfxTextOut("New Trend Up",400,15); 
}
if( (todayHISTDAILY  [i] < onedaybackHISTDAILY [i])   AND (onedaybackHISTDAILY  [i] >= twodaybackHISTDAILY [i]) )
{
GfxSetTextColor(colorOrange); 
//PrintTrends("New Trend Down",4,3); 
GfxTextOut("New Trend Down",400,15); 
}
if((todayHISTDAILY  [i] > onedaybackHISTDAILY [i])   AND (onedaybackHISTDAILY  [i] >= twodaybackHISTDAILY  [i])
)
{
GfxSetTextColor(colorLime); 
//PrintTrends("Trend Up",4,3); 
GfxTextOut("Trend Up",400,15); 
}
if( (todayHISTDAILY  [i]< onedaybackHISTDAILY [i])   AND (onedaybackHISTDAILY  [i] <= twodaybackHISTDAILY  [i])
)
{
GfxSetTextColor(colorOrange); 
//PrintTrends("Trend Down",4,3); 
GfxTextOut("Trend Down",400,15); 
}
GfxSetTextAlign( TA_left = 0);
GfxSelectFont("Tahoma", 11, 700 ); 
GfxSetTextColor(ColorRGB(230,100,200)); 
GfxTextOut("DAILY WEEKLY  MACD",07, 0); 
GfxSetTextAlign( TA_LEFT = 0 );
GfxSelectFont("Tahoma", 11, 700 ); 
GfxSetTextColor(ColorRGB(255,180,61)); 
GfxTextOut(Name()+ "   " + Date(),07,18); 
 Title = " "; 
_SECTION_END();


2 comments :

  1. MR. PRASADSIR,

    FIRST OF ALL HATS OFF YOU FOR CREATING & HELPING THIS MUCH OF PEOPLE OUT HERE...

    YOU DECIDED NOT TO PROVIDE YOUR HOLY GRAIL TO PUBLIC AFTER WISESTOCKTRADER INCIDENT, BUT SIR I LOOKED EVERY POST OF YOUR BLOG WHERE PEOPLE BEGGING FOR THAT HOLY GRAIL,

    SIR I REQUEST YOU MAY NOT PUBLIC THAT AFL BUT PLEASE PLEASE DO FEVER TO PROVIDE THAT ON EMAILS...

    PEOPLE ARE BEGGING BECAUSE THEY SOMEWHERE LOOSING UP OR WIPED OUT THEIR ACCOUNTS SO MANY TIMES, I AM ONE OF THEM.

    SIR NOW ONLY YOU & YOU CAN SAVE US.....


    MAY BE WE ARE NOT DESERVE THIS THINGS, BUY SIR WE OWE YOU IF YOU HELP US, WE OWE YOU SIR....


    THE HOPE :----

    MY EMAIL ID

    shah.abhishek7271@gmail.com

    ReplyDelete

▲Top▲