Simple Coding Help - No Promise.

amitrandive

Well-Known Member
guys very simple question(s)......(maybe no coding is needed coz its a very basic indicator)
want to plot this in amibroker:
slow stochastics (10,3,3)
in ami, there are 2 options: stochastics %D, stochastics %K
which one should i use? why are both of them seperate? i mean it should be like only 1 indicator, the "stochastic oscillator" will plot both %k and %d? (and how to plot the fast stochastics- though thats not my current requirement)

the same question seems to have been asked almost 6 yrs ago by someone else too!
http://www.traderji.com/amibroker/23937-slow-stochastics-right-one.html
Try this ,


http://www.amibroker.com/library/detail.php?id=1423&hilite=StochD
 

manishchan

Well-Known Member
Manish

Right click and change from the parameters , it is already present in the code.
:D


hehe.. not that one Amit :D.. ..I want to make the Histogram bar thicker.. in param it shows HistogramThick.. but I want lil wider and bigger. see the pic below.... I want to make these blue bar bigger and wider like dt second pic.. anyways to do dt ??




something like this pic
 

amitrandive

Well-Known Member
hehe.. not that one Amit :D.. ..I want to make the Histogram bar thicker.. in param it shows HistogramThick.. but I want lil wider and bigger. see the pic below.... I want to make these blue bar bigger and wider like dt second pic.. anyways to do dt ??




something like this pic

Managed to find this .

:D

Code:
_SECTION_BEGIN("MACD");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
 
ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
Hist = ml-sl;
 
MACUP = Hist > Ref(Hist,-1);
MACDN = Hist < Ref(Hist,-1);
 
BarColor  = IIf(MACUP,ColorRGB(134,195,119),IIf(MACDN,ColorRGB(233,157,138),colorBlue));
 
Plot( Hist, "MACD Histogram", BarColor  , styleHistogram|styleThick|styleOwnScale , 0, Null, 0, -10 , -50 );
if (ParamToggle("Tampilkan Garis MACD & Signal","Tidak|Ya",1))
{
    Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
    Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
}
 
Plot(0, "0", colorBlueGrey );
_SECTION_END();
 

manishchan

Well-Known Member

Managed to find this .

:D

Code:
_SECTION_BEGIN("MACD");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
 
ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
Hist = ml-sl;
 
MACUP = Hist > Ref(Hist,-1);
MACDN = Hist < Ref(Hist,-1);
 
BarColor  = IIf(MACUP,ColorRGB(134,195,119),IIf(MACDN,ColorRGB(233,157,138),colorBlue));
 
Plot( Hist, "MACD Histogram", BarColor  , styleHistogram|styleThick|styleOwnScale , 0, Null, 0, -10 , -50 );
if (ParamToggle("Tampilkan Garis MACD & Signal","Tidak|Ya",1))
{
    Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
    Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
}
 
Plot(0, "0", colorBlueGrey );
_SECTION_END();


Greattttt.. thank you very much !!! :)
 
_SECTION_BEGIN("MACD");
SetChartBkColor(ParamColor("Panel color ",colorLightGrey));
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
m1 = MACD(r1, r2);
s1 = Signal(r1,r2,r3);
difference = m1-s1;
Plot( m1, StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
Plot( s1, "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
Color=IIf(difference > 0,colorGreen,colorRed);
Plot(difference, "MACD Histogram", Color, styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleThick | styleNoLabel, maskHistogram ) );
_SECTION_END();


Hi everyone,
I want to add buy sell formula this indicator but I have rule

1- macd cross signal AND When cross candlestick and before candlestick have to UP candlestick ..Two candlestick up
2-signal cross macd AND when cross candlestick and before candlestick have to DOWN candlestick..Two candlestick down

Thank you for help
 

bunti_k23

Well-Known Member
guys i want to replace the text " general " which appears at the top right of the chart ,with the following two conditions

a = TEMA(C,200) > MA(C,100) AND C > EMA(C,100) AND MA(C,100) > Ref(MA(C,100),-1) AND TEMA(C,200) > Ref(TEMA(C,200),-1) AND ADX(14) > 30 AND ADX(14) > Ref(ADX(14),-1) AND RSI(100) > 55;


b = TEMA(C,200) < MA(C,100) AND C < EMA(C,100) AND MA(C,100) < Ref(MA(C,100),-1)AND TEMA(C,200) < Ref(TEMA(C,200),-1) AND ADX(14) > 30 AND ADX(14) > Ref(ADX(14),-1) AND RSI(100) < 45;


these are the two conditions now if condition 'a' met i want to plot 'STRONG UPTREND', and if condition 'b' met i want to plot 'STRONG DOWNTREND'.


i tried a lot but cudnt code it proper ,so ur help required ...here is the code


_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
HaClose = (O + H + L + C)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
xDiff = (HaHigh - Halow) * 10000;
barcolor = IIf(HaClose >= HaOpen,colorBrightGreen,colorRed);
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "", barcolor, styleCandle );

_SECTION_END();


_SECTION_BEGIN("MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 200, 1 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style", styleLine | styleNoLabel ) | styleNoRescale );
_SECTION_END();

_SECTION_BEGIN("Mid MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 45, 2, 300, 1 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style", styleLine | styleNoLabel ) | styleNoRescale );
_SECTION_END();

_SECTION_BEGIN("Long MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 100, 2, 400, 1 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style", styleLine | styleNoLabel ) | styleNoRescale );
_SECTION_END();

_SECTION_BEGIN("BBands");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorLightGrey );
Color = ColorBlend( Color, GetChartBkColor(), 0.5 );
Style = ParamStyle("Style", styleLine | styleNoLabel ) | styleNoRescale;;
Plot( bbt = BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style );
Plot( bbb = BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style );
PlotOHLC( bbt, bbt, bbb, bbb, "", ColorBlend( Color, GetChartBkColor(), 0.7 ), styleNoLabel | styleCloud | styleNoRescale, Null, Null, Null, -1 );
_SECTION_END();

_SECTION_BEGIN("Volume");
Color = ParamColor("Color", ColorRGB( 128, 128, 192 ) );
Plot( Volume, _DEFAULT_NAME(), ColorBlend( Color, GetChartBkColor(), 0.5 ), styleNoTitle | ParamStyle( "Style", styleHistogram | styleOwnScale | styleThick | styleNoLabel, maskHistogram ), 2 );
_SECTION_END();

_SECTION_BEGIN("Price Interpretation");
movshort = ParamField("Short Time MA", 8 );
movmed = ParamField("Mid Time MA", 9 );
movlong = ParamField("Long Time MA", 10 );
btop = ParamField("BBTop", 11 );
bbot = ParamField("BBBottom", 12 );
if( Status("action") == actionCommentary )
{
width = btop - bbot;
lslop = LinRegSlope( C, 30 ) + 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( tname = Name()+"("+FullName()+")" );

printf("Price and moving averages:\n");
printf( tname + " has closed " + WriteIf( C > movshort, "above" , "below" ) + " its Short time moving average. ");

printf("\nShort time moving average is currently " + WriteIf( movshort > movmed, "above", "below") + " mid-time, AND " + WriteIf( movshort > movlong, "above", "below" ) + " long time moving averages.");

printf("\nThe relationship between price and moving averages is: "+
WriteIf( C > movshort AND movshort > movmed, "bullish",
WriteIf( C < movshort AND movshort < movmed, "bearish", "neutral" ) ) + " in short-term, and "+
WriteIf( movshort > movmed AND movmed > movlong , "bullish",
WriteIf( movshort < movmed AND movmed < movlong, "bearish", "neutral" ) ) + " in mid-long term. ");

printf("\n\nBollinger Bands:\n");
printf(tname+ " has closed " +
WriteIf( C < bbot, "below the lower band by " +
WriteVal( 100 *( bbot-C )/ width, 1.1 ) + "%%. " +
WriteIf( trend < 30, " 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( trend > 30 AND trend < 70, "Although prices have broken the lower band and a downside breakout is possible, the most likely scenario for "+tname+" is to continue within current trading range.", "" ) ), "" ) +

WriteIf( C > btop, "above the upper band by " +
WriteVal( 100 *( C- btop )/ width, 1.1 ) + "%%. " +
WriteIf( trend > 70, " 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( trend > 30 AND trend < 70, "Although prices have broken the upper band and a upside breakout is possible, the most likely scenario for "+tname+" is to continue within current trading range.", "" ) ), "" ) +

WriteIf( C < btop AND ( ( btop - C ) / width ) < 0.5,
"below upper band by " +
WriteVal( 100 *( btop - C )/ width, 1.1 ) + "%%. ",
WriteIf( C < btop AND C > bbot , "above bottom band by " +
WriteVal( 100 *( C - bbot )/ width, 1.1 ) + "%%. ", "" ) ));

printf("\n"+
WriteIf( ( trend > 30 AND trend < 70 AND ( C > btop OR C < bbot ) ) AND abs(relwidth) > 40,
"This picture becomes somewhat unclear due to the fact that Bollinger Bands are currently",
"Bollinger Bands are " )+
WriteVal( abs( relwidth ), 1.1 ) + "%% " +
WriteIf( relwidth > 0, "wider" , "narrower" ) +
" than normal.");

printf("\n");

printf(
WriteIf( abs( relwidth ) < 40, "The current width of the bands (alone) does not suggest anything conclusive about the future volatility or movement of prices.","")+
WriteIf( relwidth < -40, "The narrow width of the bands suggests low volatility as compared to " + tname + "'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 " + WriteVal(BarsSince(Cross(-40,relwidth)),1.0) + " bars. The probability of a significant price move increases the longer the bands remain in this narrow range." ,"")+
WriteIf( relwidth > 40, "The large width of the bands suggest high volatility as compared to " + tname + "'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 " + WriteVal(BarsSince(Cross(relwidth,40)),1.0) + " bars.The probability of prices consolidating into a less volatile trading range increases the longer the bands remain in this wide range." ,""));

printf("\n\nThis commentary is not a recommendation to buy or sell. Use at your own risk.");
}



_SECTION_END();

////////////////////

/////////////////

_SECTION_BEGIN( "TEMA" );

Len = Param( "Period", 200, 50, 200, 1 );

Av = TEMA( C, Len );

upema = Av > Ref( Av, -1 ) AND Ref( Av, -1 ) > Ref( Av, -2 ) AND C > Av;

downema = Av < Ref( Av, -1 ) AND Ref( Av, -1 ) < Ref( Av, -2 ) AND C < Av;

Color = IIf( upema , colorGreen, IIf( downema, colorRed, colorBlue ) );

Plot( Av, "TEMA", Color, ParamStyle( "Style", styleThick, maskAll ) );

_SECTION_END();

/////////////////



Buy = TEMA(C,200) > MA(C,100) AND C > EMA(C,100) AND MA(C,100) > Ref(MA(C,100),-1) AND TEMA(C,200) > Ref(TEMA(C,200),-1) AND ADX(14) > 30 AND ADX(14) > Ref(ADX(14),-1) AND RSI(100) > 55;

Sell = TEMA(C,200) < MA(C,100) AND C < EMA(C,100) AND MA(C,100) < Ref(MA(C,100),-1)AND TEMA(C,200) < Ref(TEMA(C,200),-1) AND ADX(14) > 30 AND ADX(14) > Ref(ADX(14),-1) AND RSI(100) < 45;






Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );


x=Param("xposn",1,0,1000,1);
y=Param("yposn",1,0,1000,1);


dist = 2.5*ATR(10);
dist1 = 0.7*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Buy )
{
PlotText( "\n Heavy Fire Up Ahead " , i, L[ i ]-dist, colorBlack, colorGreen );

}
if( Sell )
{
PlotText( " Heavy Down Fall Ahead " , i, H[ i ]+dist1, colorBlack, colorRed );
}
}

////////////////////


x=Param("xposn",1,0,1000,1);
y=Param("yposn",1,0,1000,1);



C11=ParamColor("up panel",colorBlack );
C12=ParamColor("dn panel",colorBlack );
C13=Param("fonts",20,10,30,1 );
C14=Param("left-right",2.1,1.0,5.0,0.1 );
C15=Param("up-down",8,1,30,1 );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
pxwidth = Status("pxwidth");
pxheight = Status("pxheight");
GfxSetBkMode( 0 );
GfxSelectFont("Tahoma", 12, 500, False, False, 0);
GfxSetTextColor(colorCustom12);
GfxSetTextAlign( 6 );
GfxSelectFont("Tahoma", 15, 600, False, False, 0);
GfxSetTextColor(colorWhite);
GfxSetTextAlign( 6 );

GfxSelectFont("Tahoma", 12, 400, False, False, 0);
GfxSetTextColor(colorBrightGreen);

GfxSelectFont("Tahoma", 12, 400, False, False, 0);
GfxSetTextColor(colorRed);




pricechange=(C-Ref(C,-1))*100/Ref(C,-1);
changeponit=C-Ref(C,-1);
Vlp=Param("Volume lookback period",15,10,300,10);
Vrg=MA(V,Vlp);
St = StDev(Vrg,Vlp);
Vp3 = Vrg + 3*st;
Vp2 = Vrg + 2*st;;
Vp1 = Vrg + 1*st;;
Vn1 = Vrg -1*st;
Vn2 = Vrg -2*st;

x=Param("xposn",1,0,1000,1);
y=Param("yposn",1,0,1000,1);

GfxGradientRect( 1, 1, 1400, 40, colorViolet, colorBlack);
GfxSetBkMode(0);
GfxSelectFont( "Georgia", 18, 800, False );
GfxSetTextColor( colorGold );
GfxTextOut( "General ", x+600, y+10 );
GfxSelectFont( "Tahoma", 16, 800, False );
GfxSetTextColor( colorGold );
GfxTextOut( Name(), x+100, y+10 );
GfxSelectFont( "Century Gothic", 15, 100, False );
GfxSetTextColor( colorGold );
GfxTextOut( Date(), x+1000, y+10 );
GfxSelectFont( "Comic Sans MS", 15, 500, False );
GfxSetTextColor( colorYellow );
GfxTextOut( Interval(2), x+275, y+10 );
//------------------------------------------------------------ H, L, O, C----------------------

//////////////////////////



DayH = TimeFrameGetPrice("H", in1Minute, 0);
DayL = TimeFrameGetPrice("L", in1Minute, 0);
DayC = TimeFrameGetPrice("C", in1Minute, 0);
DayO = TimeFrameGetPrice("O", in1Minute, 0);
pDayC = TimeFrameGetPrice("C", in1Minute, -1);

FS=Param("Font Size",15,11,100,1);
GfxSelectFont("Comic Sans M", FS , 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( colorBlack );
Hor=Param("Horizontal Position",820,1,1200,1);
Ver=Param("Vertical Position",1,1,830,1);
GfxTextOut(""+C, Hor, Ver);
GfxSetTextColor( colorGrey50 );
GfxTextOut("PC:"+pDayC,700, Ver);
GfxSetTextColor( colorBlue );
GfxTextOut("C:"+DayC, 600, Ver);
GfxSetTextColor(colorRed );
GfxTextOut("L:"+DayL,500, Ver);
GfxSetTextColor(colorBrightGreen );
GfxTextOut("H:"+DayH,400, Ver);
GfxSetTextColor( colorLightBlue );
GfxTextOut("O:"+DayO,300, Ver);


/////////////////////////////////////////
thank you,
amit.
 
Amit,
I applied afl of macd thick histogram. I am getting error :
Plot(Hist,"MACD Histogram", BarColor,styleHistogram|styleThick|styleOwnScale,0,Null,0,-10,-50);

The cursor blinks before 50 in afl. message in the bottom getting as: Ln 15, col:92: error 16 too many agruments.
Please tell me anything to be added on afl.
vishnu_1990v
 

bunti_k23

Well-Known Member
@ sumit,

dont know this might help you ,iam not sure abt and i doubt the patterns coded in this afl but take a look and refer japanese candlestick techniques by steve nison ,for confirming the patterns from this afl....


//Apply the code to an indicator, Open up the Param window, AND drag the CandlePattern# slider left AND right.
//Each CandlePattern number selects a different candle pattern.
//The selected pattern is identified on your chart with a vertical Blue line.
//The white line on your chart represents the resulting Equity if the pattern were traded.
//Thus you can see the pattern’s profitability over your data history.
//Try different tickers, they will all behave differently. The exit delay, i.e., the delay after the candle pattern occurred before the price is sampled, is adjustable.
//Presumably some longer patterns require more bars to show profits/losses.
//The Name of the candle pattern AND a number of other stats are also shown in the Title.
//Add your own price patterns AND metrics.

O1 = Ref(O,-1);O2 = Ref(O,-2);
H1 = Ref(H,-1);H2 = Ref(H,-2);
L1 = Ref(L,-1);L2 = Ref(L,-2);
C1 = Ref(C,-1);C2 = Ref(C,-2);
function CandlePattern(P)
{
global PatternName;
if(P == 0) { PatternName = "NearDoji"; Pv = (abs(O-C)<= ((H-L)*0.1)); }
else if(P == 1) { PatternName = "BlackCandle"; Pv = (O>C); }
else if(P == 2) { PatternName = "LongBlackCandle"; Pv = (O>C AND (O-C)/(.001+H-L)>.6); }
else if(P == 3) { PatternName = "SmallBlackCandle"; Pv = ((O>C) AND ((H-L)>(3*(O-C)))); }
else if(P == 4) { PatternName = "WhiteCandle"; Pv = (C>O); }
else if(P == 5) { PatternName = "LongWhiteCandle"; Pv = ((C>O) AND ((C-O)/(.001+H-L)>.6)); }
else if(P == 6) { PatternName = "SmallWhiteCandle"; Pv = ((C>O) AND ((H-L)>(3*(C-O)))); }
else if(P == 7) { PatternName = "BlackMaubozu"; Pv = (O>C AND H==O AND C==L); }
else if(P == 8) { PatternName = "WhiteMaubozu"; Pv = (C>O AND H==C AND O==L); }
else if(P == 9) { PatternName = "BlackClosingMarubozu"; Pv = (O>C AND C==L); }
else if(P == 10) { PatternName = "WhiteClosingMarubozu"; Pv = (C>O AND C==H); }
else if(P == 11) { PatternName = "BlackOpeningMarubozu"; Pv = (O>C AND O==H); }
else if(P == 12) { PatternName = "WhiteOpeningMarubozu"; Pv = (C>O AND O==L); }
else if(P == 13) { PatternName = "HangingMan"; Pv = (((H-L)>4*(O-C)) AND ((C-L)/(.001+H-L)>= 0.75) AND ((O-L)/(.001+H-L)>= 0.75)); }
else if(P == 14) { PatternName = "Hammer"; Pv = (((H-L)>3*(O-C)) AND ((C-L)/(.001+H-L)>0.6) AND ((O-L)/(.001+H-L)>0.6)); }
else if(P == 15) { PatternName = "InvertedHammer"; Pv = (((H-L)>3*(O-C)) AND ((H-C)/(.001+H-L)>0.6) AND ((H-O)/(.001+H-L)>0.6)); }
else if(P == 16) { PatternName = "ShootingStar"; Pv = (((H-L)>4*(O-C)) AND ((H-C)/(.001+H-L)>= 0.75) AND ((H-O)/(.001+H-L)>= 0.75)); }
else if(P == 17) { PatternName = "BlackSpinningTop"; Pv = ((O>C) AND ((H-L)>(3*(O-C))) AND (((H-O)/(.001+H-L))<.4) AND (((C-L)/(.001+H-L))<.4)); }
else if(P == 18) { PatternName = "WhiteSpinningTop"; Pv = ((C>O) AND ((H-L)>(3*(C-O))) AND (((H-C)/(.001+H-L))<.4) AND (((O-L)/(.001+H-L))<.4)); }
else if(P == 19) { PatternName = "BearishAbandonedBaby"; Pv = ((C1 == O1) AND (C2>O2) AND (O>C) AND (L1>H2) AND (L1>H)); }
else if(P == 20) { PatternName = "BearishEveningDojiStar"; Pv = ((C2>O2) AND ((C2-O2)/(.001+H2-L2)>.6) AND (C2<O1) AND (C1>O1) AND ((H1-L1)>(3*(C1-O1))) AND (O>C) AND (O<O1)); }
else if(P == 21) { PatternName = "DarkCloudCover"; Pv = (C1>O1 AND ((C1+O1)/2)>C AND O>C AND O>C1 AND C>O1 AND (O-C)/(.001+(H-L)>0.6)); }
else if(P == 22) { PatternName = "BearishEngulfing"; Pv = ((C1>O1) AND (O>C) AND (O>= C1) AND (O1>= C) AND ((O-C)>(C1-O1))); }
else if(P == 23) { PatternName = "ThreeOutsideDownPattern"; Pv = ((C2>O2) AND (O1>C1) AND (O1>= C2) AND (O2>= C1) AND ((O1-C1)>(C2-O2)) AND (O>C) AND (C<C1)); }
else if(P == 24) { PatternName = "BullishAbandonedBaby"; Pv = ((C1 == O1) AND (O2>C2) AND (C>O) AND (L2>H1) AND (L>H1)); }
else if(P == 25) { PatternName = "BullishMorningDojiStar"; Pv = ((O2>C2) AND ((O2-C2)/(.001+H2-L2)>.6) AND (C2>O1) AND (O1>C1) AND ((H1-L1)>(3*(C1-O1))) AND (C>O) AND (O>O1)); }
else if(P == 26) { PatternName = "BullishEngulfing"; Pv = ((O1>C1) AND (C>O) AND (C>= O1) AND (C1>= O) AND ((C-O)>(O1-C1))); }
else if(P == 27) { PatternName = "ThreeOutsideUpPattern"; Pv = ((O2>C2) AND (C1>O1) AND (C1>= O2) AND (C2>= O1) AND ((C1-O1)>(O2-C2)) AND (C>O) AND (C>C1)); }
else if(P == 28) { PatternName = "BullishHarami"; Pv = ((O1>C1) AND (C>O) AND (C<= O1) AND (C1<= O) AND ((C-O)<(O1-C1))); }
else if(P == 29) { PatternName = "ThreeInsideUpPattern"; Pv = ((O2>C2) AND (C1>O1) AND (C1<= O2) AND (C2<= O1) AND ((C1-O1)<(O2-C2)) AND (C>O) AND (C>C1) AND (O>O1)); }
else if(P == 30) { PatternName = "PiercingLine"; Pv = ((C1<O1) AND (((O1+C1)/2)<C) AND (O<C) AND (O<C1) AND (C<O1) AND ((C-O)/(.001+(H-L))>0.6)); }
else if(P == 31) { PatternName = "BearishHarami"; Pv = ((C1>O1) AND (O>C) AND (O<= C1) AND (O1<= C) AND ((O-C)<(C1-O1))); }
else if(P == 32) { PatternName = "ThreeInsideDownPattern"; Pv = ((C2>O2) AND (O1>C1) AND (O1<= C2) AND (O2<= C1) AND ((O1-C1)<(C2-O2)) AND (O>C) AND (C<C1) AND (O<O1)); }
else if(P == 33) { PatternName = "ThreeWhiteSoldiers"; Pv = (C>O*1.01) AND (C1>O1*1.01) AND (C2>O2*1.01) AND (C>C1) AND (C1>C2) AND (O<C1) AND (O>O1) AND (O1<C2) AND (O1>O2) AND (((H-C)/(H-L))<.2) AND (((H1-C1)/(H1-L1))<.2) AND (((H2-C2)/(H2-L2))<.2); }
else if(P == 34) { PatternName = "DarkCloudCover"; Pv = (C1>O1*1.01) AND (O>C) AND (O>H1) AND (C>O1) AND (((C1+O1)/2)>C) AND (C>O1) AND (MA(C,13)-Ref(MA(C,13),-4)>0); }
else if(P == 35) { PatternName = "ThreeBlackCrows"; Pv = (O>C*1.01) AND (O1>C1*1.01) AND (O2>C2*1.01) AND (C<C1) AND (C1<C2) AND (O>C1) AND (O<O1) AND (O1>C2) AND (O1<O2) AND (((C-L)/(H-L))<.2) AND (((C1-L1)/(H1-L1))<.2) AND (((C2-L2)/(H2-L2))<.2); }
else if(P == 36) { PatternName = "doji"; Pv = (O == C); }
else if(P == 37) { PatternName = "GapUp"; Pv = GapUp(); }
else if(P == 38) { PatternName = "GapDown"; Pv = GapDown(); }
else if(P == 39) { PatternName = "BigGapUp"; Pv = L>1.01*H1; }
else if(P == 40) { PatternName = "BigGapDown"; Pv = H<0.99*L1; }
else if(P == 41) { PatternName = "HugeGapUp"; Pv = L>1.02*H1; }
else if(P == 42) { PatternName = "HugeGapDown"; Pv = H<0.98*L1; }
else if(P == 43) { PatternName = "DoubleGapUp"; Pv = GapUp() AND Ref(GapUp(),-1); }
else if(P == 44) { PatternName = "DoubleGapDown"; Pv = GapDown() AND Ref(GapDown(),-1); }
return Pv;
}
P = Param("CandlePattern#",20,0,44,1);
PP = Param("Profit period",0,0,10,1);
CandlePatternTrue = CandlePattern(P);
NextBar = Ref(CandlePatternTrue,-1);
ProfitFormula = (Ref(C,PP)-O)/O*100;
Profit = IIf(NextBar,ProfitFormula,0);
SetOption("AllowSameBarExit",True);
Short = 0;
Cover = 0;
Buy = Nextbar AND Ref(C>O,-1);
BuyPrice = Open;
Sell = Buy; //Ref(Buy,-PP);
SellPrice = C;
SecondBar = BarIndex()==2;
ProfitArray = Cum(Profit);
SimpleProfit = LastValue(ProfitArray);
CompoundedProfit = (LastValue(AMA2(1,(SecondBar==1),(SecondBar==0)*(1 + Profit/100)))-1)*100;
Upday = IIf(NextBar, (C-O)>0,0);
downDay = IIf(NextBar, (C-O)<0,0);
PatternColor = IIf(CandlePatternTrue,2,1);
NumUpDays = LastValue(Cum(UpDay));
NumDownDays = LastValue(Cum(downDay));
NumPatterns = LastValue(Cum(CandlePatternTrue ));
LowestInDisplay = Lowest(ValueWhen(Status("barVisible"),L));
HighestInDisplay = Highest(ValueWhen(Status("Barvisible"),H));
Plot(C,"Close",colorBlack,64);
Plot(ProfitArray,"",2,1|styleOwnScale);
Plot(IIf(CandlePatternTrue,L-0.005,Null),"",6,styleHistogram);
PlotShapes(UpDay*shapeUpArrow,colorBrightGreen,0,L);
PlotShapes(downDay*shapeDownArrow,colorRed,0,H);
Title = "\nCANDLE PATTERN ANALYSIS\n\n"+
"Open: "+NumToStr(O,1.2)+"\n"+
"High: "+NumToStr(H,1.2)+"\n"+
"Low: "+NumToStr(L,1.2)+"\n"+
"Close: "+NumToStr(C,1.2)+"\n\n"+
"Candle Pattern: "+PatternName+"\n"+
"Candle Pattern# "+NumToStr(P,1.0)+"\n"+
"#Patterns found: "+NumToStr(NumPatterns ,1.0)+"\n"+
"#Updays: "+NumToStr(NumUpDays,1.0,False)+
" ["+NumToStr(Nz(NumUpDays/NumPatterns*100),1.0,False)+"%]\n"+
"#DownDays: "+NumToStr(NumDownDays,1.0,False)+
" ["+NumToStr(Nz(NumDownDays/numpatterns*100),1.0,False)+"%]\n\n"+
"Profit at cursor: "+NumToStr(Profit,1.4)+"%\n"+
"Ave.Profit/Pattern:"+NumToStr(Nz(SimpleProfit/NumPatterns),1.4)+"%\n"+
"Tot.Simple profit: "+NumToStr(SimpleProfit,1.4)+"%\n"+
"Tot.Comp. profit: "+NumToStr(CompoundedProfit,1.4)+"%\n";
 
hello to all .

i am attaching an afl which plots bullish engulfing and bearish engulfing candles without cluttering the chart too much ! it plots on charts and i dont know whether it scans these patterns or not since for scanning i use keystock .

the code is very big and makes the charts cluttered so i have put // ( forward slashes ) this makes the chart look nice and clean

best regards


PHP:
_SECTION_BEGIN("CANDLE REWORKING combination of Meta TC TS");
O1 = Ref(O,-1);O2 = Ref(O,-2);O3 = Ref(O,-3);O4 = Ref(O,-4);
H1 = Ref(H,-1);H2 = Ref(H,-2);H3 = Ref(H,-3);H4 = Ref(H,-4);
C1 = Ref(C,-1);C2 = Ref(C,-2);C3 = Ref(C,-3);C4 = Ref(C,-4);
L1 = Ref(L,-1);L2 = Ref(L,-2);L3 = Ref(L,-3);L4 = Ref(L,-4);
GraphXSpace = 5;
/*UP and Down Trend of last 4 days*/
dtrend = (L1 < L2)AND (L2 < L3) AND (L3 < L4);
utrend = (H1 > H2)AND (H2 > H3) AND (H3 > H4);
/*Maximum High Today - (MHT)
Today is the maximum High in the last 5 days*/
MHT=  HHV(H,5)==H;
/*Maximum High Yesterday - (MHY)
Yesterday is the maximum High in the last 5 days*/
MHY=   HHV(H,5)==Ref ( H, -1);
/*Minimum Low Today - (MLT)
Today is the minimum Low in the last 5 days*/
MLT=   LLV(L,5)==L;
/*Minimum Low Yesterday - (MLY)
Yesterday is the minimum Low in the last 5 days*/
MLY=   LLV(L,5)==Ref(L,-1);
/*Peircing Percent*/
PiercingPercent = ((C - C1)/C1) * 100;
LongBlackCandle = (O>C AND (O-C)/(.001+H-L)>.6); 
LongWhiteCandle  = ((C>O) AND ((C-O)/(.001+H-L)>.6)); 
OpenGap = ((C1 - O)/O) * 100;

CloseGap = ((O - C1)/C1) * 100;
///////************************************** Engulfings ********************************************//////////////
BullishEngulfing  = (LongWhiteCandle AND dtrend AND (O1>C1) AND (C>O) AND (C>= O1) AND (C1>= O) AND ((C-O)>(O1-C1))); 
_SECTION_BEGIN("");
BI = BarIndex();
BV = BeginValue(BarIndex());
EV = EndValue(BarIndex());
SV = SelectedValue(BarIndex());
BuWholeEngulf = 0;					
CurrentBar = SelectedValue( BarIndex() ); 
FirstBullBar = CurrentBar - 30;
Bar = CurrentBar;
do
{
if ( SelectedValue(Close) >= ( Open[Bar-1]) AND SelectedValue(Close) >= ( Close[Bar-1]) AND SelectedValue(Open) <= ( Open[Bar-1]) AND SelectedValue(Open) <= ( Close[Bar-1]) )
		{
				BuWholeEngulf = BuWholeEngulf + 1; 
			    Bar--;  
		}
  
}
while( Bar> FirstBullBar  AND   SelectedValue(Close) >= ( Open[Bar-1]) AND SelectedValue(Close) >= ( Close[Bar-1]) AND SelectedValue(Open) <= ( Open[Bar-1]) AND SelectedValue(Open) <= ( Close[Bar-1]));
_SECTION_END();

_SECTION_BEGIN("");

BearishEngulfing  = (MHT AND utrend  AND LongBlackCandle AND (C1>O1) AND (O>C) AND (O>= C1) AND (O1>= C) AND ((O-C)>(C1-O1)));
_SECTION_BEGIN("");
BI = BarIndex();
BV = BeginValue(BarIndex());
EV = EndValue(BarIndex());
SV = SelectedValue(BarIndex());
BeWholeEngulf = 0;					
CurrentBar = SelectedValue( BarIndex() ); 
FirstBearBar = CurrentBar - 30;
Bar = CurrentBar;

do
{

if ( SelectedValue(Close) <= ( Open[Bar-1]) AND SelectedValue(Close) <= ( Close[Bar-1]) AND SelectedValue(Open) >= ( Open[Bar-1]) AND SelectedValue(Open) >= ( Close[Bar-1]) )
		{
				
					BeWholeEngulf = BeWholeEngulf + 1; 
				               
 Bar--;
		}
      
}
while( Bar> FirstBearBar  AND   SelectedValue(Close) <= ( Open[Bar-1]) AND SelectedValue(Close) <= ( Close[Bar-1]) AND SelectedValue(Open) >= ( Open[Bar-1]) AND SelectedValue(Open) >= ( Close[Bar-1]));
								 
_SECTION_END();

/***********************************************************************************
                                   LABELS  
***********************************************************************************/
 
//_SECTION_BEGIN("PRASAD SYSTEMS");
//Param("DEDICATED TO MY FATHER",5);
//_SECTION_END();

_SECTION_BEGIN("");
CANDLE_LABELS_TOGGLE = ParamToggle("Labels","Off|On",1);
if(CANDLE_LABELS_TOGGLE==1)
{

for( a = 0; a < BarCount; a++ )
{
 

if (BullishEngulfing[a]) (PlotText("  BuE",a,H[a]+2,colorPaleGreen));

if (BearishEngulfing[a]) (PlotText("BeE",a,H[a]+2,colorRed));


}
}

CANDLE_ARROWS_TOGGLE = ParamToggle("CANDLE ARROWS","Off|On",1);
if(CANDLE_ARROWS_TOGGLE==1)
{

(PlotShapes(BullishEngulfing * shapeSmallUpTriangle,colorPaleGreen,0,H,10));


(PlotShapes(BearishEngulfing * shapeSmallDownTriangle,colorLightOrange,0,H,-20));


}
_SECTION_END();



BULL_ENG = LastValue(Cum(BullishEngulfing)); 
printf("Bull Eng %g\n",BULL_ENG);
PlotText( "*",BULL_ENG,H[BULL_ENG]+4, colorYellow ); 

CURRENT_BULL_ENG = Ref(BullishEngulfing,0);

PRI_CANDLE_BULLISH = WriteIf(BullishEngulfing,"Bullish Engulfing","");

PRI_CANDLE_BEARISH =  WriteIf(BearishEngulfing,"Bearish Engulfing","");


/******************************************************************************************
                   CHART TITLES
***********************************************************************************************/




SetBarFillColor( IIf(O>C,colorOrange, colorDarkGreen ) ); 
Plot( C, "Price", IIf( O>C,colorRed, colorGreen ), styleCandle );

Plot(C,"Close",colorWhite,64);
Chg=Ref(C,-1);
Title = EncodeColor(colorYellow)+  Title = Name() + "    " + EncodeColor(2) + Date() +EncodeColor(11) + EncodeColor(colorWhite) + "{{INTERVAL}}  " +
   EncodeColor(55)+ "   Open:  "+ EncodeColor(colorWhite)+ WriteVal(O,format=1.2) + 
   EncodeColor(55)+ "   High:  "+ EncodeColor(colorWhite) + WriteVal(H,format=1.2) +
   EncodeColor(55)+ "   Low:  "+ EncodeColor(colorWhite)+ WriteVal(L,format=1.2) + 
   EncodeColor(55)+ "   Close:  "+ WriteIf(C> Chg,EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ WriteVal(C,format=1.2)+  
   EncodeColor(55)+ "   Change:  "+ WriteIf(C> Chg,EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ WriteVal(ROC(C,1),format=1.2)+ "%"+
   EncodeColor(55)+ "   Volume: "+ EncodeColor(colorWhite)+ WriteVal(V,1)



+"\n"+"\n"

+"\n"+EncodeColor(colorWhite)+"> Candle           : "+EncodeColor(colorBrightGreen)+PRI_CANDLE_BULLISH + 

EncodeColor(colorRed)+PRI_CANDLE_BEARISH + EncodeColor(colorRed)+"."+


"\n"+/***********************************************************************************************
Standards of Cover (Moderate and low Reliability)
/****************************************************************************************************/
EncodeColor(colorOrange)+
WriteIf(BullishEngulfing,"> Prior Trend    " + EncodeColor(colorWhite) + ": Bearish.\n"+
EncodeColor(colorOrange)+"> Type                " + EncodeColor(colorWhite) + ": Reversal.\n"+
EncodeColor(colorOrange)+"> Confirmation " + EncodeColor(colorWhite) + ": Required.\n"+"\n"+
EncodeColor(colorLightBlue)+"> IMPORTANT FACTORS   " + EncodeColor(colorWhite) + "\n"+
EncodeColor(colorYellow)+"1) Disparity of white vs black body is indicative of the\n     emerging bull power.\n" +
"2) Higher probability of reversal if there is heavy\n     volume on the day of second real body.\n" +
"3) Higher probability of reversal if the second day\n     body engulfs more than one real body. \n" +
"4) Greater the open gaps down from previous close\n     greater the probability of strong reversal. \n" +
"5) If engulfing body engulfs body and shadow of the\n     previous day may be probability of strong reversal. \n \n" +

EncodeColor(colorPink)+" > CONFIRMATION :\n Third Day Confirmation needed in form of a \na)  white candle ,\nb)  large gap up or \nc)  higher close.\n\n" +
EncodeColor(colorRed)+" > CURRENT CANDLE\n"+
EncodeColor(colorAqua)+" *  The gap down opening of the current candle is\n     "+Prec(OpenGap,1)+" % from previous Day.\n" +
"*  The current white body is engulfing the\n    preceeding "+BuWholeEngulf+" bodies","")+




EncodeColor(colorOrange)+
WriteIf(BearishEngulfing,"> Prior Trend    " + EncodeColor(colorWhite) + ": Bullish.\n"+
EncodeColor(colorOrange)+"> Type                " + EncodeColor(colorWhite) + ": Reversal.\n"+
EncodeColor(colorOrange)+"> Confirmation " + EncodeColor(colorWhite) + ": Required.\n"+"\n"+
EncodeColor(colorLightBlue)+"> IMPORTANT FACTORS   " + EncodeColor(colorWhite) + "\n"+
EncodeColor(colorYellow)+"1) Disparity of black vs white body is indicative of the\n     emerging bear power.\n" +
"2) Higher probability of reversal if there is heavy\n     volume on the day of second real body.\n" +
"3) Higher probability of reversal if the second day\n     body engulfs more than one real body. \n" +
"4) Greater the open gaps up from previous close\n     greater the probability of strong reversal. \n" +
"5) If engulfing body engulfs body and shadow of the\n     previous day may be probability of strong reversal. \n \n" +

EncodeColor(colorPink)+" > CONFIRMATION :\n Third Day Confirmation needed in form of a \na)  black candle ,\nb)  large gap down or \nc)  lower close.\n\n" +
EncodeColor(colorRed)+" > CURRENT CANDLE\n"+
EncodeColor(colorAqua)+" *  The gap up opening of the current candle is\n     "+Prec(CloseGap,1)+" % from previous Day.\n" +
"*  The current black body is engulfing the\n    preceeding "+BeWholeEngulf+" bodies","") ;

_SECTION_BEGIN("CANDLE REWORKING combination of Meta TC TS");
O1 = Ref(O,-1);O2 = Ref(O,-2);O3 = Ref(O,-3);O4 = Ref(O,-4);
H1 = Ref(H,-1);H2 = Ref(H,-2);H3 = Ref(H,-3);H4 = Ref(H,-4);
C1 = Ref(C,-1);C2 = Ref(C,-2);C3 = Ref(C,-3);C4 = Ref(C,-4);
L1 = Ref(L,-1);L2 = Ref(L,-2);L3 = Ref(L,-3);L4 = Ref(L,-4);

GraphXSpace = 5;

/*UP and Down Trend of last 4 days*/

dtrend = (L1 < L2)AND (L2 < L3) AND (L3 < L4);
utrend = (H1 > H2)AND (H2 > H3) AND (H3 > H4);

/*Maximum High Today - (MHT)
Today is the maximum High in the last 5 days*/
MHT=  HHV(H,5)==H;

/*Maximum High Yesterday - (MHY)
Yesterday is the maximum High in the last 5 days*/
MHY=   HHV(H,5)==Ref ( H, -1);

/*Minimum Low Today - (MLT)
Today is the minimum Low in the last 5 days*/
MLT=   LLV(L,5)==L;

/*Minimum Low Yesterday - (MLY)
Yesterday is the minimum Low in the last 5 days*/
MLY=   LLV(L,5)==Ref(L,-1);

/*Peircing Percent*/

PiercingPercent = ((C - C1)/C1) * 100;











LongBlackCandle = (O>C AND (O-C)/(.001+H-L)>.6); 

 

 

LongWhiteCandle  = ((C>O) AND ((C-O)/(.001+H-L)>.6)); 




OpenGap = ((C1 - O)/O) * 100;

CloseGap = ((O - C1)/C1) * 100;





///////************************************** Engulfings ********************************************//////////////
BullishEngulfing  = (LongWhiteCandle AND dtrend AND (O1>C1) AND (C>O) AND (C>= O1) AND (C1>= O) AND ((C-O)>(O1-C1))); 




_SECTION_BEGIN("");
BI = BarIndex();
BV = BeginValue(BarIndex());
EV = EndValue(BarIndex());
SV = SelectedValue(BarIndex());

BuWholeEngulf = 0;					
CurrentBar = SelectedValue( BarIndex() ); 
FirstBullBar = CurrentBar - 30;
Bar = CurrentBar;

do
{
if ( SelectedValue(Close) >= ( Open[Bar-1]) AND SelectedValue(Close) >= ( Close[Bar-1]) AND SelectedValue(Open) <= ( Open[Bar-1]) AND SelectedValue(Open) <= ( Close[Bar-1]) )
		{
				BuWholeEngulf = BuWholeEngulf + 1; 
			    Bar--;  
		}
      
}
while( Bar> FirstBullBar  AND   SelectedValue(Close) >= ( Open[Bar-1]) AND SelectedValue(Close) >= ( Close[Bar-1]) AND SelectedValue(Open) <= ( Open[Bar-1]) AND SelectedValue(Open) <= ( Close[Bar-1]));
_SECTION_END();


_SECTION_BEGIN("");

 




		

BearishEngulfing  = (MHT AND utrend  AND LongBlackCandle AND (C1>O1) AND (O>C) AND (O>= C1) AND (O1>= C) AND ((O-C)>(C1-O1)));



_SECTION_BEGIN("");
BI = BarIndex();
BV = BeginValue(BarIndex());
EV = EndValue(BarIndex());
SV = SelectedValue(BarIndex());

BeWholeEngulf = 0;					
CurrentBar = SelectedValue( BarIndex() ); 
FirstBearBar = CurrentBar - 30;
Bar = CurrentBar;

do
{

if ( SelectedValue(Close) <= ( Open[Bar-1]) AND SelectedValue(Close) <= ( Close[Bar-1]) AND SelectedValue(Open) >= ( Open[Bar-1]) AND SelectedValue(Open) >= ( Close[Bar-1]) )
		{
				
					BeWholeEngulf = BeWholeEngulf + 1; 
				               
 Bar--;
		}
      
}
while( Bar> FirstBearBar  AND   SelectedValue(Close) <= ( Open[Bar-1]) AND SelectedValue(Close) <= ( Close[Bar-1]) AND SelectedValue(Open) >= ( Open[Bar-1]) AND SelectedValue(Open) >= ( Close[Bar-1]));
								 
_SECTION_END();


/***********************************************************************************
                                   LABELS  
***********************************************************************************/
 
//_SECTION_BEGIN("PRASAD SYSTEMS");
//Param("DEDICATED TO MY FATHER",5);
//_SECTION_END();

_SECTION_BEGIN("");
CANDLE_LABELS_TOGGLE = ParamToggle("Labels","Off|On",1);
if(CANDLE_LABELS_TOGGLE==1)
{

for( a = 0; a < BarCount; a++ )
{
 

if (BullishEngulfing[a]) (PlotText("  BuE",a,H[a]+2,colorPaleGreen));

if (BearishEngulfing[a]) (PlotText("BeE",a,H[a]+2,colorRed));


}
}

CANDLE_ARROWS_TOGGLE = ParamToggle("CANDLE ARROWS","Off|On",1);
if(CANDLE_ARROWS_TOGGLE==1)
{

(PlotShapes(BullishEngulfing * shapeSmallUpTriangle,colorPaleGreen,0,H,10));


(PlotShapes(BearishEngulfing * shapeSmallDownTriangle,colorLightOrange,0,H,-20));


}
_SECTION_END();

BULL_ENG = LastValue(Cum(BullishEngulfing)); 
printf("Bull Eng %g\n",BULL_ENG);
PlotText( "*",BULL_ENG,H[BULL_ENG]+4, colorYellow ); 

CURRENT_BULL_ENG = Ref(BullishEngulfing,0);

PRI_CANDLE_BULLISH = WriteIf(BullishEngulfing,"Bullish Engulfing","");

PRI_CANDLE_BEARISH =  WriteIf(BearishEngulfing,"Bearish Engulfing","");


/******************************************************************************************
                   CHART TITLES
***********************************************************************************************/


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 on his 75th Birth  Anniversay - LATE BALKRISHNA RAMCHANDRA RAO 13.10.1935",100+k ,12); 
GfxSelectFont("Century Goliath",12,500); 
GfxSetBkMode(1); 
GfxSetTextColor(colorLime); 
//GfxTextOut("Prasad Inspirations",80 ,25); 
RequestTimedRefresh(1); 
_SECTION_END();

SetBarFillColor( IIf(O>C,colorOrange, colorDarkGreen ) ); 
Plot( C, "Price", IIf( O>C,colorRed, colorGreen ), styleCandle );

Plot(C,"Close",colorWhite,64);
Chg=Ref(C,-1);
Title = EncodeColor(colorYellow)+  Title = Name() + "    " + EncodeColor(2) + Date() +EncodeColor(11) + EncodeColor(colorWhite) + "{{INTERVAL}}  " +
   //EncodeColor(55)+ "   Open:  "+ EncodeColor(colorWhite)+ WriteVal(O,format=1.2) + 
   //EncodeColor(55)+ "   High:  "+ EncodeColor(colorWhite) + WriteVal(H,format=1.2) +
   //EncodeColor(55)+ "   Low:  "+ EncodeColor(colorWhite)+ WriteVal(L,format=1.2) + 
   //EncodeColor(55)+ "   Close:  "+ WriteIf(C> Chg,EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ WriteVal(C,format=1.2)+  
   //EncodeColor(55)+ "   Change:  "+ WriteIf(C> Chg,EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ WriteVal(ROC(C,1),format=1.2)+ "%"+
   EncodeColor(55)+ "   Volume: "+ EncodeColor(colorWhite)+ WriteVal(V,1)



+"\n"+"\n"

+"\n"+EncodeColor(colorWhite)+"> Candle           : "+EncodeColor(colorBrightGreen)+PRI_CANDLE_BULLISH + 

EncodeColor(colorRed)+PRI_CANDLE_BEARISH + EncodeColor(colorRed)+"."+


"\n"+/***********************************************************************************************
Standards of Cover (Moderate and low Reliability)
/****************************************************************************************************/
EncodeColor(colorOrange)+
WriteIf(BullishEngulfing,"> Prior Trend    " + EncodeColor(colorWhite) + ": Bearish.\n"+
//EncodeColor(colorOrange)+"> Type                " + EncodeColor(colorWhite) + ": Reversal.\n"+
//EncodeColor(colorOrange)+"> Confirmation " + EncodeColor(colorWhite) + ": Required.\n"+"\n"+
//EncodeColor(colorLightBlue)+"> IMPORTANT FACTORS   " + EncodeColor(colorWhite) + "\n"+
//EncodeColor(colorYellow)+"1) Disparity of white vs black body is indicative of the\n     emerging bull power.\n" +
//"2) Higher probability of reversal if there is heavy\n     volume on the day of second real body.\n" +
//"3) Higher probability of reversal if the second day\n     body engulfs more than one real body. \n" +
//"4) Greater the open gaps down from previous close\n     greater the probability of strong reversal. \n" +
//"5) If engulfing body engulfs body and shadow of the\n     previous day may be probability of strong reversal. \n \n" +

//EncodeColor(colorPink)+" > CONFIRMATION :\n Third Day Confirmation needed in form of a \na)  white candle ,\nb)  large gap up or \nc)  higher close.\n\n" +
//EncodeColor(colorRed)+" > CURRENT CANDLE\n"+
//EncodeColor(colorAqua)+" *  The gap down opening of the current candle is\n     "+Prec(OpenGap,1)+" % from previous Day.\n" +
"*  The current white body is engulfing the\n    preceeding "+BuWholeEngulf+" bodies","")+




//EncodeColor(colorOrange)+
WriteIf(BearishEngulfing,"> Prior Trend    " + EncodeColor(colorWhite) + ": Bullish.\n"+
//EncodeColor(colorOrange)+"> Type                " + EncodeColor(colorWhite) + ": Reversal.\n"+
//EncodeColor(colorOrange)+"> Confirmation " + EncodeColor(colorWhite) + ": Required.\n"+"\n"+
//EncodeColor(colorLightBlue)+"> IMPORTANT FACTORS   " + EncodeColor(colorWhite) + "\n"+
//EncodeColor(colorYellow)+"1) Disparity of black vs white body is indicative of the\n     emerging bear power.\n" +
//"2) Higher probability of reversal if there is heavy\n     volume on the day of second real body.\n" +
//"3) Higher probability of reversal if the second day\n     body engulfs more than one real body. \n" +
//"4) Greater the open gaps up from previous close\n     greater the probability of strong reversal. \n" +
//"5) If engulfing body engulfs body and shadow of the\n     previous day may be probability of strong reversal. \n \n" +

//EncodeColor(colorPink)+" > CONFIRMATION :\n Third Day Confirmation needed in form of a \na)  black candle ,\nb)  large gap down or \nc)  lower close.\n\n" +
//EncodeColor(colorRed)+" > CURRENT CANDLE\n"+
//EncodeColor(colorAqua)+" *  The gap up opening of the current candle is\n     "+Prec(CloseGap,1)+" % from previous Day.\n" +
"*  The current black body is engulfing the\n    preceeding "+BeWholeEngulf+" bodies","") ;
 

amitrandive

Well-Known Member
Amit,
I applied afl of macd thick histogram. I am getting error :
Plot(Hist,"MACD Histogram", BarColor,styleHistogram|styleThick|styleOwnScale,0,Null,0,-10,-50);

The cursor blinks before 50 in afl. message in the bottom getting as: Ln 15, col:92: error 16 too many agruments.
Please tell me anything to be added on afl.
vishnu_1990v
Vishnu

Please check whether you have copied the entire code correctly.It is working fine.
Also check the version of Amibroker you are using.
 

Similar threads