Simple Coding Help - No Promise.

Hello Amit ji n all,

Need a small help to form a Exploration (Pin bar outside Default bollinger band (20,2))


Conditions -

1) Buy = Bullish pin bar formation outside lower bollinger band...

2) Sell = Bearish pin bar formation outside higher bollinger band...


Picture is attached with it.

Thanx in advance
 
Last edited:

amitrandive

Well-Known Member
Hello Amit ji n all,

Need a small help to form a Exploration (Pin bar outside Default bollinger band (20,2))


Conditions -

1) Buy = Bullish pin bar formation outside lower bollinger band...

2) Sell = Bearish pin bar formation outside higher bollinger band...


Picture is attached with it.

Thanx in advance
Try this , should work.:thumb:

Code:
blpin = (((H-L)>6*(O-C)) AND ((C-L)/(.001+H-L)>0.6) AND ((O-L)/(.001+H-L)>0.6));
brpin = (((H-L)>6*(O-C)) AND ((H-C)/(.001+H-L)>0.7) AND ((H-O)/(.001+H-L)>0.7));
top1=BBandTop(20,2);
bot1=BBandBot(20,2);
Buy=Cross(C,bot1)AND blpin;
Sell=Cross(top1,C)AND brpin;
Filter=Buy OR Sell;
AddColumn(IIf(Buy,BuyPrice,Null)," Buy Signal ", 6.2,1.2,colorGreen); 
AddColumn(IIf(Sell,SellPrice,Null)," Sell Signal ",6.2,1.2,colorOrange);
 
Guys.. plz convert this amibroker afl to Metatrader programm..

Plz guys.. its urgent...

thanks in advance.. im not getting any reply's in my thread.. so im coming back to this thread which helped me in past.

_SECTION_BEGIN("SMART TRADING SYSTEM ");
GraphXSpace = 15;
A = DEMA(C,2);
BH = DEMA(a,34)+2*(StDev(a,34));
BL = DEMA(a,34)-2*(StDev(a,34));
BM = (BH+BL)/2;
Highs = TEMA(High, 30);
Lows = TEMA(Low, 30);
A = DEMA(L,2);
BH = DEMA(A,34)+2*(StDev(A,34));
BL = DEMA(A,34)-2*(StDev(A,34));
BM = (BH+BL)/2;
A = DEMA(H,2);
BH = DEMA(A,34)+2*(StDev(A,34));
BL = DEMA(A,34)-2*(StDev(A,34));
UpTrend = C > Highs;
DnTrend = C < Lows ;
BM1 = (BH+BL)/2;
Sell=Cross(BM,C);
Buy=Cross(C,BM1);
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
PlotShapes(IIf(Buy, shapeHollowUpArrow, shapeNone),colorGreen, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeHollowDownArrow, shapeNone),colorRed, 0, H, Offset=-15);Colors = IIf(UpTrend, colorGreen, IIf(DnTrend, colorRed, colorLightGrey));
Plot(Close, "Price", Colors, styleCandle | styleThick);
 

Nehal_s143

Well-Known Member
I was trying to use this afl for 10 min chart using time frame expand, indicator plotted is correct but when we scroll chart values are getting changed....

please check where i went wrong.....

Code:
/*________________________________________________________________________________________________________________
CREDITS -

System Concept & Design - Sanjay Khandelwall (http://in.linkedin.com/in/sanjaykhandelwal1)
Amibroker Implementation for Concept Demonstration - rmike.
Intellectual Copyright - Sanjay Khandelwall (Concept & Design)

WEB RESOURCE - http://eqtrend.blogspot.in/p/trading-with-tripe-trend-oscillator.html

AFL VERSION & RELEASE DATE - V1.0, 11 Mar 15. For *********** Forum Members.

WARNING - This AFL may be used for personal educational puposes only.
The right to re-package and/ or commercialize/ market this AFL in any way
is not granted to any user. However, this AFL is permitted to be distributed for free
(without modifications), with due acknowledgement of credit to designer & coder. 

DISCLAIMER -

This AFL is for educational purposes only as per the ideas described in the web resource.
This is a concept demonstrator and is NOT the system plugin by Sanjay Khandelwall which is
available at the web resource. The chosen trend periods are non optimized.
No backtested results for this AFL are provided and no trading success percentage is claimed.
The coder neither makes any claim as to the efficacy of this AFL for usage in live trading,
nor wishes to incite/ induce (either implicitly OR explicitly) anyone to engage in live trading.
You are hereby FOREWARNED that the usage of this AFL for live trading will be entirely at
YOUR OWN discretion and risk.
________________________________________________________________________________________________________________*/


_SECTION_BEGIN("Triple Oscillator 10min");
tf=10;
tfrm=in1Minute*tf;
TimeFrameSet(tfrm);

function mtm( array, period )
{
  return array - Ref( array, -period );
}

mom = mtm(C, 1);
ab_mom = abs(mom);

function e_mtm( array, period )
{
  return EMA (EMA (EMA (array, period), period - 1), period - 2);
} 

function e_abmtm( array, period )
{
  return EMA (EMA (EMA (array, period), period - 1), period - 2);
}

a = e_mtm(mom, 3);
b = e_abmtm(ab_mom, 3);
d = e_mtm(mom, 9);
e = e_abmtm(ab_mom, 9);
f = e_mtm(mom, 27);
g = e_abmtm(ab_mom, 27);
x = DEMA (DEMA (DEMA (mom, 3), 2), 1); 
y = TEMA (TEMA (TEMA (mom, 3), 2), 1);

ts_stt = a/b; //trend strength short term
sig_stt = EMA(ts_stt, 2);
ts_itt = d/e; //trend strength intermediate term
sig_itt = EMA(ts_itt, 4);
ts_ltt = f/g; //trend strength long term
sig_ltt = EMA(ts_ltt, 17);

trig_1 = x/b; //fast trigger
trig_2 = y/b; //smoothed trigger (optional)

TimeFrameRestore();


ts_st2f = TimeFrameExpand( ts_stt, tfrm);
ts_it2f = TimeFrameExpand( ts_itt, tfrm);
ts_lt2f = TimeFrameExpand( ts_ltt, tfrm);
sig_st2f = TimeFrameExpand( sig_stt, tfrm);
sig_it2f = TimeFrameExpand( sig_itt, tfrm);
sig_lt2f = TimeFrameExpand( sig_ltt, tfrm);


Col_shortt = IIf(ts_st2f >= sig_st2f, colorPaleGreen, colorPink);
Col_intert = IIf(ts_it2f >= sig_it2f, colorBlue, colorOrange);
Col_longt = IIf(ts_lt2f >= sig_lt2f, colorLime, colorRed);


GraphXSpace = -10;
Plot(0, "", colorWhite, styleThick|styleNoTitle|styleNoLabel);
//Plot(trig_1, "TO Signal", colorYellow, styleDots|styleOwnScale); 
PlotOHLC(sig_stt, ts_stt, sig_stt, ts_stt, "TO Short", Col_shortt, styleCloud); 
PlotOHLC(sig_itt, ts_itt, sig_itt, ts_itt, "TO Inter", Col_intert, styleCloud);
PlotOHLC(sig_ltt, ts_ltt, sig_ltt, ts_ltt, "TO Long", Col_longt, styleCloud);


Plot(3, "", col_shortt, styleArea|styleOwnScale|styleNoTitle|styleNoLabel,1,50);
Plot(6, "", col_intert, styleArea|styleOwnScale|styleNoTitle|styleNoLabel,1,50);
Plot(9, "", col_longt, styleArea|styleOwnScale|styleNoTitle|styleNoLabel,1,50);


_SECTION_END();
 
I was trying to use this afl for 10 min chart using time frame expand, indicator plotted is correct but when we scroll chart values are getting changed....

please check where i went wrong.....

Code:
/*________________________________________________________________________________________________________________
CREDITS -

System Concept & Design - Sanjay Khandelwall (http://in.linkedin.com/in/sanjaykhandelwal1)
Amibroker Implementation for Concept Demonstration - rmike.
Intellectual Copyright - Sanjay Khandelwall (Concept & Design)

WEB RESOURCE - http://eqtrend.blogspot.in/p/trading-with-tripe-trend-oscillator.html

AFL VERSION & RELEASE DATE - V1.0, 11 Mar 15. For *********** Forum Members.

WARNING - This AFL may be used for personal educational puposes only.
The right to re-package and/ or commercialize/ market this AFL in any way
is not granted to any user. However, this AFL is permitted to be distributed for free
(without modifications), with due acknowledgement of credit to designer & coder. 

DISCLAIMER -

This AFL is for educational purposes only as per the ideas described in the web resource.
This is a concept demonstrator and is NOT the system plugin by Sanjay Khandelwall which is
available at the web resource. The chosen trend periods are non optimized.
No backtested results for this AFL are provided and no trading success percentage is claimed.
The coder neither makes any claim as to the efficacy of this AFL for usage in live trading,
nor wishes to incite/ induce (either implicitly OR explicitly) anyone to engage in live trading.
You are hereby FOREWARNED that the usage of this AFL for live trading will be entirely at
YOUR OWN discretion and risk.
________________________________________________________________________________________________________________*/


_SECTION_BEGIN("Triple Oscillator 10min");
tf=10;
tfrm=in1Minute*tf;
TimeFrameSet(tfrm);

function mtm( array, period )
{
  return array - Ref( array, -period );
}

mom = mtm(C, 1);
ab_mom = abs(mom);

function e_mtm( array, period )
{
  return EMA (EMA (EMA (array, period), period - 1), period - 2);
} 

function e_abmtm( array, period )
{
  return EMA (EMA (EMA (array, period), period - 1), period - 2);
}

a = e_mtm(mom, 3);
b = e_abmtm(ab_mom, 3);
d = e_mtm(mom, 9);
e = e_abmtm(ab_mom, 9);
f = e_mtm(mom, 27);
g = e_abmtm(ab_mom, 27);
x = DEMA (DEMA (DEMA (mom, 3), 2), 1); 
y = TEMA (TEMA (TEMA (mom, 3), 2), 1);

ts_stt = a/b; //trend strength short term
sig_stt = EMA(ts_stt, 2);
ts_itt = d/e; //trend strength intermediate term
sig_itt = EMA(ts_itt, 4);
ts_ltt = f/g; //trend strength long term
sig_ltt = EMA(ts_ltt, 17);

trig_1 = x/b; //fast trigger
trig_2 = y/b; //smoothed trigger (optional)

TimeFrameRestore();


ts_st2f = TimeFrameExpand( ts_stt, tfrm);
ts_it2f = TimeFrameExpand( ts_itt, tfrm);
ts_lt2f = TimeFrameExpand( ts_ltt, tfrm);
sig_st2f = TimeFrameExpand( sig_stt, tfrm);
sig_it2f = TimeFrameExpand( sig_itt, tfrm);
sig_lt2f = TimeFrameExpand( sig_ltt, tfrm);


Col_shortt = IIf(ts_st2f >= sig_st2f, colorPaleGreen, colorPink);
Col_intert = IIf(ts_it2f >= sig_it2f, colorBlue, colorOrange);
Col_longt = IIf(ts_lt2f >= sig_lt2f, colorLime, colorRed);


GraphXSpace = -10;
Plot(0, "", colorWhite, styleThick|styleNoTitle|styleNoLabel);
//Plot(trig_1, "TO Signal", colorYellow, styleDots|styleOwnScale); 
PlotOHLC(sig_stt, ts_stt, sig_stt, ts_stt, "TO Short", Col_shortt, styleCloud); 
PlotOHLC(sig_itt, ts_itt, sig_itt, ts_itt, "TO Inter", Col_intert, styleCloud);
PlotOHLC(sig_ltt, ts_ltt, sig_ltt, ts_ltt, "TO Long", Col_longt, styleCloud);


Plot(3, "", col_shortt, styleArea|styleOwnScale|styleNoTitle|styleNoLabel,1,50);
Plot(6, "", col_intert, styleArea|styleOwnScale|styleNoTitle|styleNoLabel,1,50);
Plot(9, "", col_longt, styleArea|styleOwnScale|styleNoTitle|styleNoLabel,1,50);


_SECTION_END();
I don't see any flicker... Maybe I am not seeing it same context as you are.

Anyways, there are few things that may be done to minimise the flicker

1) Use SetBarsRequired(sbrAll) at the start.
2) Experiment with ExpandFirst in the TimeFrameExpand functions....
3) Instead of Close price, use relatively stable prices such as Open, High Low or any averaged out permutation thereof.

Suggestion #3 is a paradigm shift
 
Seniors,

This is Nikar repainting code. can anyone help in converting this to non repainting code?

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

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

_SECTION_BEGIN("Arrow Detection tm");


Buy= Cross(MACD(05,30),Signal(05,30,10));
Sell = Cross( Signal(05,30,10), MACD(05,30) );


PlotShapes(IIf(Buy, shapeHollowUpArrow,shapeNone) ,colorWhite,0, Low, Offset=-25) ;
PlotShapes(IIf(Sell, shapeHollowDownArrow,shapeNone),colorWhite,0, High, Offset=-25) ;

_SECTION_END();



_SECTION_BEGIN("MACD Exploration");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Z=Param("zig",1,0,10,0.1);


Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3));

Cond3 = Zig(C,z)>Ref(Zig(C,z),-4);
Buy = Cond1 AND Cond3;

Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2));

Cond6 = Zig(C,z)<Ref(Zig(C,z),-4);
Sell = Cond4 AND Cond6;
Trigger = WriteIf(Buy, "Buy", "") + WriteIf(Sell, "Sell", "");

_SECTION_BEGIN("ZIG-ZAG");
P = ParamField( "Price field" );
change = Param("% change",5,0.1,25,0.1);
_SECTION_END();

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
_SECTION_END();

_SECTION_BEGIN("MACD Exploration");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Z=Param("zig",1,0,10,0.1);


Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3));

Cond3 = Zig(C,z)>Ref(Zig(C,z),-4);
Buy = Cond1 AND Cond3;

Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2));

Cond6 = Zig(C,z)<Ref(Zig(C,z),-4);
Sell = Cond4 AND Cond6;
Trigger = WriteIf(Buy, "Buy", "") + WriteIf(Sell, "Sell", "");

_N(Title = StrFormat("{{NAME}} {{DATE}} {{INTERVAL}}: O=%1.2f, H=%1.2f, L=%1.2f, C=%1.2f, V=%1.0f\n{{VALUES}}", O, H, L, C, V));

BG = IIf(Buy, colorPaleGreen, IIf(Sell, colorRose, colorDefault));
FG = IIf(Buy, colorDarkGreen, IIf(Sell, colorDarkRed, colorDefault));

if(Status("action") == actionIndicator)
{
Plot(C, "", colorGrey50, styleBar);
PlotShapes(IIf(Buy, shapeCircle, shapeNone),colorGreen, 0,L, Offset=-40);
PlotShapes(IIf(Sell, shapeCircle, shapeNone),colorRed, 0,H, Offset=40);
PlotShapes(shapeHollowDownArrow*Sell,colorYellow,0,SellPrice,-05);
PlotShapes(shapeHollowUpArrow*Buy,colorYellow,0,BuyPrice,-05);

}

_SECTION_BEGIN("Arrow Detection");

Buy= Cross(MACD(12,26),Signal(12,26,9));
Sell = Cross( Signal(12, 26, 9), MACD(12,26) );

PlotShapes(IIf(Buy, shapeUpArrow,shapeNone) ,colorGreen,0, Low, Offset=-10) ;
PlotShapes(IIf(Sell, shapeDownArrow,shapeNone),colorRed,0, High, Offset=-10) ;

_SECTION_END();

_SECTION_BEGIN("Live Market Price");
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorLightBlue) );
Hor=Param("Horizontal Position",373,1,1200,1);
Ver=Param("Vertical Position",45,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( colorWhite );
GfxSetTextColor(ParamColor("Color",colorBlack) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor , Ver+45 );

_SECTION_END();
 

amitrandive

Well-Known Member
Seniors,

This is Nikar repainting code. can anyone help in converting this to non repainting code?

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 10, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorBlue ), ParamStyle("Style") );
_SECTION_END();
.
.
.
_SECTION_END();

_SECTION_BEGIN("Live Market Price");
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorLightBlue) );

_SECTION_END();

This AFL uses Zig function.It will look to the future and repaint.
 

amitrandive

Well-Known Member
Thanks amit for the response.
Please, if you could make it non repainting with red and green dots as entry and exit points.
Removed the Zig function,hopefully should not repaint.
:D
Code:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

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

_SECTION_BEGIN("Arrow Detection tm");


Buy= Cross(MACD(05,30),Signal(05,30,10));
Sell = Cross( Signal(05,30,10), MACD(05,30) );


PlotShapes(IIf(Buy, shapeHollowUpArrow,shapeNone) ,colorWhite,0, Low, Offset=-25) ;
PlotShapes(IIf(Sell, shapeHollowDownArrow,shapeNone),colorWhite,0, High, Offset=-25) ;

_SECTION_END();



_SECTION_BEGIN("MACD Exploration");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Z=Param("zig",1,0,10,0.1);


Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3));

//Cond3 = Zig(C,z)>Ref(Zig(C,z),-4);
Buy = Cond1;

Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2));

//Cond6 = Zig(C,z)<Ref(Zig(C,z),-4);
Sell = Cond4;
Trigger = WriteIf(Buy, "Buy", "") + WriteIf(Sell, "Sell", "");

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
_SECTION_END();

_SECTION_BEGIN("MACD Exploration");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Z=Param("zig",1,0,10,0.1);


Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3));

//Cond3 = Zig(C,z)>Ref(Zig(C,z),-4);
Buy = Cond1;

Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2));

//Cond6 = Zig(C,z)<Ref(Zig(C,z),-4);
Sell = Cond4;
Trigger = WriteIf(Buy, "Buy", "") + WriteIf(Sell, "Sell", "");

_N(Title = StrFormat("{{NAME}} {{DATE}} {{INTERVAL}}: O=%1.2f, H=%1.2f, L=%1.2f, C=%1.2f, V=%1.0f\n{{VALUES}}", O, H, L, C, V));

BG = IIf(Buy, colorPaleGreen, IIf(Sell, colorRose, colorDefault));
FG = IIf(Buy, colorDarkGreen, IIf(Sell, colorDarkRed, colorDefault));

if(Status("action") == actionIndicator)
{
Plot(C, "", colorGrey50, styleBar);
PlotShapes(IIf(Buy, shapeCircle, shapeNone),colorGreen, 0,L, Offset=-40);
PlotShapes(IIf(Sell, shapeCircle, shapeNone),colorRed, 0,H, Offset=40);
PlotShapes(shapeHollowDownArrow*Sell,colorYellow,0 ,SellPrice,-05);
PlotShapes(shapeHollowUpArrow*Buy,colorYellow,0,BuyPrice,-05);

}

_SECTION_BEGIN("Arrow Detection");

Buy= Cross(MACD(12,26),Signal(12,26,9));
Sell = Cross( Signal(12, 26, 9), MACD(12,26) );

PlotShapes(IIf(Buy, shapeUpArrow,shapeNone) ,colorGreen,0, Low, Offset=-10) ;
PlotShapes(IIf(Sell, shapeDownArrow,shapeNone),colorRed,0, High, Offset=-10) ;

_SECTION_END();

_SECTION_BEGIN("Live Market Price");
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorLightBlue) );
Hor=Param("Horizontal Position",373,1,1200,1);
Ver=Param("Vertical Position",45,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( colorWhite );
GfxSetTextColor(ParamColor("Color",colorBlack) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor , Ver+45 );

_SECTION_END();
 
Try this , should work.:thumb:

Code:
blpin = (((H-L)>6*(O-C)) AND ((C-L)/(.001+H-L)>0.6) AND ((O-L)/(.001+H-L)>0.6));
brpin = (((H-L)>6*(O-C)) AND ((H-C)/(.001+H-L)>0.7) AND ((H-O)/(.001+H-L)>0.7));
top1=BBandTop(20,2);
bot1=BBandBot(20,2);
Buy=Cross(C,bot1)AND blpin;
Sell=Cross(top1,C)AND brpin;
Filter=Buy OR Sell;
AddColumn(IIf(Buy,BuyPrice,Null)," Buy Signal ", 6.2,1.2,colorGreen); 
AddColumn(IIf(Sell,SellPrice,Null)," Sell Signal ",6.2,1.2,colorOrange);


Amit ji ,

Kindly check the formula once... Pin bar are not selected properly.

My requirement

Bullish Pin bar (Close candle) should be outside bollinger band = Buy

Bearish Pin bar (Close candle) Should be Outside bolllinger band = Sell


Thanx you
 

Similar threads