Saturday, June 22, 2013


Dear investor ,

long time break,
well ,
above posted AMIBROKER AFL is simple MY TREND FOLLOW STRATEGY AFL,
FIRST ... FIND TREND ........... IF DAY HIGH BREAK BUY
                                                    IF, DAY LOW BREAK SELL ,
                                                   TRADE WITH TREND , NOT AGAINST ,
SECOND....... FIND HOURLY TREND .....IF HOURLY HIGH BREAK BUY
                                                    IF, HOURL LOW BREAK SELL ,
                                                   TRADE WITH TREND , NOT AGAINST ,
ALSO USE EMA CALCULATION - 5 MIN CHARTS - 3 EMA (3*5= 15 MIN EMA) *
                                                                                        - 12 EMA ( 12*5= 60 MIN EMA)
                                                                                 -  78 EMA (390 MIN)  CLEAR CONFIRMATION

ALSO EVERY TRADE , DOWNSIDE SEE MACD PANEL,

BEST AFL FOR 5 MIN CHARTS ... GOOD WORKS,,,

PLZ LOOK INTO YOUR PC - COPY WITH AMIBROKER

MOHAN TFS STRATAGY AFL -

_SECTION_BEGIN("MOHAN Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

trendup = IIf(MACD(12,26) > 0 AND MACD(12,26) > Signal(12,26,9), colorGreen, colorWhite);
trendcolor = IIf(MACD(12,26) < 0 AND MACD(12,26) < Signal(12,26,9), colorRed, trendup);
Plot( C, "Close", trendcolor, styleCandle | styleThick );

//RSIup = RSI(7) > 80;
//RSIdown = RSI(7) < 20;

sp = Param( "RSI Period", 7, 1, 100 );
r = RSI( sp );
RSIup = r > 70;
RSIdown = r < 30;

shape = RSIup * shapeNone + RSIdown * shapeNone;
PlotShapes(shape, IIf( RSIup, colorBrightGreen, colorRed ), 0, IIf( RSIup, Low, High ) );

if( ParamToggle("Tooltip shows", "All Values | Only Prices" ) )
{
 ToolTip=StrFormat("Open: %g\nHigh:  %g\nLow:   %g\nClose:  %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}
_SECTION_END();


//mohanjamkhedkar.blogspot.com//
//ESSENTIAL TRADER TOOLS//
//Previous Days HI LO //

DayH = TimeFrameGetPrice("H", inDaily, -1)*(1+0.0005); DayHI = LastValue (DayH,1);// yesterdays high
DayL = TimeFrameGetPrice("L", inDaily, -1)*(1-0.0005); DayLI = LastValue (DayL,1); // yesterdays low
DayC = TimeFrameGetPrice("C", inDaily, -1); // yesterdays close
DayO = TimeFrameGetPrice("O", inDaily); // current day open


numbars = LastValue(Cum(Status("barvisible")));
hts  = -33.5;

YHL = ParamToggle("Yesterday HI LO","Hide|Show",1);
if(YHL==1) {
  Plot(DayL,"YL",colorRed,styleNoRescale|styleNoTitle);
  Plot(DayH,"YH",colorGreen,styleNoRescale|styleNoTitle);
  PlotText(" YstrdayH " , LastValue(BarIndex())-(numbars/Hts), DayHI, colorGreen);
  PlotText(" YstrdayL " , LastValue(BarIndex())-(numbars/Hts), DayLI, colorRed);}



//Magfied Market Price
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorBrightGreen) );
Hor=Param("Horizontal Position",940,1,1200,1);
Ver=Param("Vertical Position",12,1,830,1);
GfxTextOut(""+C, Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Times New Roman", 11, 700, True );
GfxSetBkMode( colorBlack );
GfxSetTextColor(ParamColor("Color",colorYellow) );
GfxTextOut(""+DD+"  ("+xx+"%)", Hor , Ver+45 );



_SECTION_END();


//mohanjamkhedkar.blogspot.com//
//ESSENTIAL TRADER TOOLS//
//Previous Days HI LO //

DayH = TimeFrameGetPrice("H", inHourly, -1); DayHI = LastValue (DayH,1);// hourly high
DayL = TimeFrameGetPrice("L", inHourly, -1); DayLI = LastValue (DayL,1); // hourly low
DayC = TimeFrameGetPrice("C", inHourly, -1); // yesterdays close
DayO = TimeFrameGetPrice("O", inHourly); // current day open


numbars = LastValue(Cum(Status("barvisible")));
hts  = -33.5;

YHL = ParamToggle("Yesterday HI LO","Hide|Show",1);
if(YHL==1) {
  Plot(DayL,"YL",colorRose,styleNoRescale|styleNoTitle);
  Plot(DayH,"YH",colorPaleGreen,styleNoRescale|styleNoTitle );
  PlotText(" Pre hour H " , LastValue(BarIndex())-(numbars/Hts), DayHI, colorPaleGreen);
  PlotText(" Pre hour L " , LastValue(BarIndex())-(numbars/Hts), DayLI, colorRose);}

_SECTION_BEGIN("MOHAN CROSSOVER");


P = ParamField("Price field",-1);
Periods1 = Param("Periods1", 5, 2, 300, 1, 10 );
Periods2 = Param("Periods2", 20, 2, 300, 1, 10 );
Plot( MA( P, Periods1 ), StrFormat(_SECTION_NAME()+"(%g)", Periods1), ParamColor( "Color1", colorRed ), ParamStyle("Style") );
Plot( MA( P, Periods2 ), StrFormat(_SECTION_NAME()+"(%g)", Periods2), ParamColor( "Color2", colorBlue ), ParamStyle("Style") );
Buy = Cross( MA( P, Periods1 ), MA( P, Periods2 ) );
Sell = Cross(MA( P,Periods2 ), MA( P, Periods1 ) );
Display= ParamToggle("Display","Off|On",0);

PlotOHLC( Null,MA( P, Periods1 ),MA( P, Periods2 ),Null, "", IIf(MA( P, Periods1 )>MA( P, Periods2 ) ,colorDarkGreen,colorDarkRed), styleCloud);

Color = IIf( MA(p,periods1) > MA(p,periods2) , colorLime, IIf( MA(p,periods2) > MA(p,periods1), colorRed, colorGrey50 ));
Plot( 1, "", Color, styleArea | styleOwnScale | styleNoLabel, -0.1, 30 );

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();


ALSO NEW PANE - GET MACD SETTING -

_SECTION_BEGIN("MOHAN MACD");
r = Param( "TSI period 'R':", 7, 1, 100, 1 );
s = Param( "TSI period 'S':", 27, 1, 100, 1 );
u = Param( "TSI period 'U':", 1, 1, 100, 1 );
sig = Param( "Signal period:", 7, 1, 100, 1 );

Mtm = C - Ref ( C, -1 );
AbsMtm = abs ( Mtm );
Num_T = EMA ( EMA( EMA ( Mtm, r ), s ), u );
Den_T = EMA ( EMA( EMA ( AbsMtm, r ), s ), u);

TSI = 100 * Nz ( Num_T / Den_T );
TSIL = 100 * Nz ( Num_T / Den_T );

//Green TSIL Line=Rising; Red TSIL Line=Falling
col = IIf( TSIL > Ref( TSIL, -1 ), colorGreen, colorRed );
Plot( TSIL, "TSI("+r+","+s+","+u+")", col, styleLine | styleThick);
//Green EMA TSI,sig Line=Rising; Red EMA TSI,sig Line=Falling
col = IIf( EMA(TSI,sig) > Ref( EMA(TSI,sig), -1 ), colorGreen, colorRed );
Plot( EMA(TSI,sig), "", col, styleThick);
Histcol= IIf(TSI>0,colorLime,colorRed) ;
Plot( TSI, "", histcol, ParamStyle("Histogram style", styleThick |
styleHistogram | styleNoLabel, maskHistogram ) );
Plot(0,"",ParamColor( "ColorZero", colorBrown ),styleLine);

//Title = "MOHAN MACD";
_SECTION_END();

_SECTION_BEGIN("MACDval");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );


dynamic_color = IIf( MACD() > 0, colorGreen, colorRed);
MACD_trend = IIf( MACD() >= 0, 0.5, -0.5);
Plot( 2, "ribbon",IIf( MACD_trend>=0, colorLime, colorRed ), styleOwnScale|styleArea|styleNoLabel, 0, 100 );

I HOPE YOU LIKE FOR THIS ,,,,

IF, ANY MORE GOOD WORKING SHARE WITH ME,,,,,, THANK YOU ,,

2 comments:

Arunamahasree Karthikeyaraj said...

sir copied your afl but the chart is not loading properly please help me and guide me to set it correctly.

manikam said...

thanks sir