Simple Coding Help - No Promise.

Hi,

Can someone point out the pros & cons (including limitations) of using Amibroker Version 5.0 (Cracked).
 

bunti_k23

Well-Known Member
nehal and yasu thanks for ur kind reply, what i was asking is i want to take the trade on next candle not on signal candle ,the signal candle will indicate to take the trade but ....to validate that signal candle i will wait for next candle to cross the high or lets say r2(in case of buying ) and to cross the low or lets say s2 (in case of selling)....in following pic this condition is shown visually hope it clarifies the situation....:)


http://imgur.com/opaOUby&0LV6zt6

http://imgur.com/opaOUby&0LV6zt6#1
 
nehal and yasu thanks for ur kind reply, what i was asking is i want to take the trade on next candle not on signal candle ,the signal candle will indicate to take the trade but ....to validate that signal candle i will wait for next candle to cross the high or lets say r2(in case of buying ) and to cross the low or lets say s2 (in case of selling)....in following pic this condition is shown visually hope it clarifies the situation....:)


http://imgur.com/opaOUby&0LV6zt6

http://imgur.com/opaOUby&0LV6zt6#1
in place of "C" use Ref(C,-1)
example-

LONG = Ref(C,-1)>R1 ; //"R1" FROM PIVOT SYNTAX
SHORT = Ref(C,-1)<S1; // "S1" FROM PIVOT SYNTAX

BUY = ExRem(LONG,SHORT);
SELL = ExRem(SHORT,LONG);
COVER = BUY;
SHORT = SELL;

// Before you have to assign R1 and S1 in the AFL //
 

bunti_k23

Well-Known Member
bro something is went wrong this is the orignal code below, timeframe is 5min

/*
Formula Name: Turtle trading system
Author/Uploader: DrZingaro
E-mail: [email protected]
Date Added: 2009-01-12
Origin: Turtle trading experimemnt Chandelier exit based on Chuck Lebeau's work
Keywords: Trend trading
Level: Basic
Flags: System
*/
//=============================SETUP================ ======================
//Strengths: volatility-based.
//Weaknesses: lag AND since volatility increases at the end of a trend, traders exits early.
//Description: Indicator is used to keep track of a trade. Once a stop is hit, it waits for the next entry Signal (Short OR long). Use on DAILY values only.
//Algorithm: Lebeau recommends that an exits hangs from the HHV (long) OR LLV (Short) since the trade was triggered. Some traders use the Highest Close as the base for hanging the exit.

pds = 20;
MAFAST = EMA( Close, 20 );
MASLOW = EMA( Close, 40 );

DonchianUpper = HHV( Ref( H, -1 ), pds ); // Highest high value of highs in last 20 periods
DonchianLower = LLV( Ref( L, -1 ), pds ); // Lowest low value of low in last 20 periods
DonchianMiddle = ( DonchianUpper + DonchianLower ) / 2;

UpTrend = C > ( LLV( L, 20 ) + 2 * ATR( 10 ) ) AND EMA( Close, 20 ) > EMA( Close, 40 );
DnTrend = C < ( HHV( H, 20 ) - 2 * ATR( 10 ) ) AND EMA( Close, 20 ) < EMA( Close, 40 );
Color = IIf( UpTrend, colorBlue, IIf( DnTrend, colorOrange, colorCustom11 ) );

// Plots a 20 period Donchian channel
Plot( C, "Price", Color, styleBar | styleThick );
Plot( DonchianUpper, "Donchian U", ParamColor( "DU Color", colorBlue ), ParamStyle( "DU Style", styleLine ) );
Plot( DonchianMiddle, "Donchian M", ParamColor( "DM Color", colorBrightGreen ), ParamStyle( "DM Style", styleNoLine ) );
Plot( DonchianLower, "Donchian L", ParamColor( "DL Color", colorRed ), ParamStyle( "DL Style", styleLine ) );

Title = WriteVal( DonchianUpper, 1.2 ) + WriteVal( DonchianLower, 1.2 ) + WriteVal( DonchianMiddle, 1.2 );
//=============================TRIGGERS AND ENTRIES=======================
Buy = High > Ref( HHV( High, 20 ), -1 ) AND MAFAST > MASLOW; // Enters long trade

Short = Low < Ref( LLV( Low, 20 ), -1 ) AND MAFAST < MASLOW; // Enters short trade



//=============================EXITS================ ======================
_SECTION_BEGIN( "Chandelier Exit" );

SetBarsRequired( 50, 50 );

Multiple = Param( "Multiple", 3, 0.5, 10, 0.1 ); // How many ATR’s to be allowed below the highest high since latest "buy" bar
ATRPeriods = Param( "ATR Periods", 20, 1, 50, 1 ); // How many periods to use for the ATR

stopArray = Null;
atrArray = ATR( ATRPeriods );
HHArray = Null;
LLArray = Null;
exitArray = Null;
trendDirection = 0;

for ( i = 0; i < BarCount; i++ )
{
if ( Short )
{
// we just triggered a short trade. Set up starting values
stopArray = Low + ( Multiple * atrArray );
LLArray = Low; // initialize the lowest low array
trendDirection = 0 - 1; // going short. Base bar.
}

if ( Buy )
{
// we just triggered a long trade. Set up starting values
stopArray = High - ( Multiple * atrArray );
HHArray = High; // initialize the highest high array
trendDirection = 1; // going long. Base bar flag is now set.
}

exitArray = 0;

if ( trendDirection > 0 )
{
// keep track of the highest high, highest close, highest low, etc..
if ( trendDirection > 1 )
{
// We are in the trade (2nd day or later)
if ( Low < stopArray[i-1] )
{
//stop got hit. Reset the trade.
trendDirection = 0; // OK. wait until we trigger another trade.
exitArray = 1;
}
else
{
// keep track of the HHV since trade was entered.
if ( High > HHArray[i-1] )
HHArray = High;
else
HHArray = HHArray[i-1];

// Compute the stop based on the HHV.
stopArray = HHArray - ( Multiple * atrArray );
}
}

trendDirection = trendDirection + 1;
}

if ( trendDirection < 0 )
{
// keep track of the lowest low, lowest close, lowest high, etc..
if ( trendDirection < 0 - 1 )
{
// We are in the trade (2nd day or later)
if ( High > stopArray[i-1] )
{
// our stop got hit. Reset the trade.
trendDirection = 0;
exitArray = 0 - 1;
}
else
{
// keep track of the LLV since trade was entered.
if ( Low < LLArray[i-1] )
LLArray = Low;
else
LLArray = LLArray[i-1];

// Compute the stop based on the LLV.
stopArray = LLArray + ( Multiple * atrArray );
}
}

trendDirection = trendDirection - 1;
}

if ( trendDirection == 0 )
{
stopArray = 0;
LLArray = 0;
HHArray = 0;
}
}

Sell = Cover = exitarray;

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

PlotShapes( Buy*shapeUpArrow, colorBrightGreen, 0, Low );
PlotShapes( Short*shapeDownArrow, colorRed, 0, High );
PlotShapes( abs( exitArray )*shapeHollowCircle, colorYellow, 0, ValueWhen( stopArray, stopArray, 1 ), 0 );
Plot( stopArray, "Chand", ParamColor( "Chand Color:", colorYellow ), ParamStyle( "Chand Style", styleDashed ) );

_N( Title = EncodeColor( colorYellow ) + StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}}--Turtle_System_Rev_A \n OP= %g Hi= %g Lo= %g CL= %g (%.1f%%) \n Vol= " + WriteVal( V, 1.0 ) + "\n" + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );//=cnb

//_N(Title = "LLArray: " + LLArray + ", HHArray:" + HHArray +", stopArray"+stopArray);

//PlotShapes(shapeCircle * Sell, colorRed);
//PlotShapes(shapeCircle * Cover, colorGreen);
_SECTION_END();
 
Last edited:

bunti_k23

Well-Known Member
i made this modification below showing some different signals ....





/*
Formula Name: Turtle trading system
Author/Uploader: DrZingaro
E-mail: [email protected]
Date Added: 2009-01-12
Origin: Turtle trading experimemnt Chandelier exit based on Chuck Lebeau's work
Keywords: Trend trading
Level: Basic
Flags: System
*/
//=============================SETUP================ ======================
//Strengths: volatility-based.
//Weaknesses: lag AND since volatility increases at the end of a trend, traders exits early.
//Description: Indicator is used to keep track of a trade. Once a stop is hit, it waits for the next entry Signal (Short OR long). Use on DAILY values only.
//Algorithm: Lebeau recommends that an exits hangs from the HHV (long) OR LLV (Short) since the trade was triggered. Some traders use the Highest Close as the base for hanging the exit.

{
PP = (H + L + C)/3;
R1 = (2*PP) - L;
S1 = (2*PP) - H;
R2 = PP + (H - L);
S2 = PP - (H - L);
R3 = R1 + (H - L);
S3 = S1 - (H - L);
}



pds = 20;
MAFAST = EMA( Close, 20 );
MASLOW = EMA( Close, 40 );

DonchianUpper = HHV( Ref( H, -1 ), pds ); // Highest high value of highs in last 20 periods
DonchianLower = LLV( Ref( L, -1 ), pds ); // Lowest low value of low in last 20 periods
DonchianMiddle = ( DonchianUpper + DonchianLower ) / 2;

UpTrend = C > ( LLV( L, 20 ) + 2 * ATR( 10 ) ) AND EMA( Close, 20 ) > EMA( Close, 40 );
DnTrend = C < ( HHV( H, 20 ) - 2 * ATR( 10 ) ) AND EMA( Close, 20 ) < EMA( Close, 40 );
Color = IIf( UpTrend, colorBlue, IIf( DnTrend, colorOrange, colorCustom11 ) );

// Plots a 20 period Donchian channel
Plot( C, "Price", Color, styleBar | styleThick );
Plot( DonchianUpper, "Donchian U", ParamColor( "DU Color", colorBlue ), ParamStyle( "DU Style", styleLine ) );
Plot( DonchianMiddle, "Donchian M", ParamColor( "DM Color", colorBrightGreen ), ParamStyle( "DM Style", styleNoLine ) );
Plot( DonchianLower, "Donchian L", ParamColor( "DL Color", colorRed ), ParamStyle( "DL Style", styleLine ) );

Title = WriteVal( DonchianUpper, 1.2 ) + WriteVal( DonchianLower, 1.2 ) + WriteVal( DonchianMiddle, 1.2 );
//=============================TRIGGERS AND ENTRIES=======================
Buy = High > Ref( HHV( High, 20 ), -1 )>R1 AND MAFAST > MASLOW; // Enters long trade

Short = Low < Ref( LLV( Low, 20 ), -1 )<S1 AND MAFAST < MASLOW; // Enters short trade



//=============================EXITS================ ======================
_SECTION_BEGIN( "Chandelier Exit" );

SetBarsRequired( 50, 50 );

Multiple = Param( "Multiple", 3, 0.5, 10, 0.1 ); // How many ATR’s to be allowed below the highest high since latest "buy" bar
ATRPeriods = Param( "ATR Periods", 20, 1, 50, 1 ); // How many periods to use for the ATR

stopArray = Null;
atrArray = ATR( ATRPeriods );
HHArray = Null;
LLArray = Null;
exitArray = Null;
trendDirection = 0;

for ( i = 0; i < BarCount; i++ )
{
if ( Short )
{
// we just triggered a short trade. Set up starting values
stopArray = Low + ( Multiple * atrArray );
LLArray = Low; // initialize the lowest low array
trendDirection = 0 - 1; // going short. Base bar.
}

if ( Buy )
{
// we just triggered a long trade. Set up starting values
stopArray = High - ( Multiple * atrArray );
HHArray = High; // initialize the highest high array
trendDirection = 1; // going long. Base bar flag is now set.
}

exitArray = 0;

if ( trendDirection > 0 )
{
// keep track of the highest high, highest close, highest low, etc..
if ( trendDirection > 1 )
{
// We are in the trade (2nd day or later)
if ( Low < stopArray[i-1] )
{
//stop got hit. Reset the trade.
trendDirection = 0; // OK. wait until we trigger another trade.
exitArray = 1;
}
else
{
// keep track of the HHV since trade was entered.
if ( High > HHArray[i-1] )
HHArray = High;
else
HHArray = HHArray[i-1];

// Compute the stop based on the HHV.
stopArray = HHArray - ( Multiple * atrArray );
}
}

trendDirection = trendDirection + 1;
}

if ( trendDirection < 0 )
{
// keep track of the lowest low, lowest close, lowest high, etc..
if ( trendDirection < 0 - 1 )
{
// We are in the trade (2nd day or later)
if ( High > stopArray[i-1] )
{
// our stop got hit. Reset the trade.
trendDirection = 0;
exitArray = 0 - 1;
}
else
{
// keep track of the LLV since trade was entered.
if ( Low < LLArray[i-1] )
LLArray = Low;
else
LLArray = LLArray[i-1];

// Compute the stop based on the LLV.
stopArray = LLArray + ( Multiple * atrArray );
}
}

trendDirection = trendDirection - 1;
}

if ( trendDirection == 0 )
{
stopArray = 0;
LLArray = 0;
HHArray = 0;
}
}

Sell = Cover = exitarray;

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

PlotShapes( Buy*shapeUpArrow, colorBrightGreen, 0, Low );
PlotShapes( Short*shapeDownArrow, colorRed, 0, High );
PlotShapes( abs( exitArray )*shapeHollowCircle, colorYellow, 0, ValueWhen( stopArray, stopArray, 1 ), 0 );
Plot( stopArray, "Chand", ParamColor( "Chand Color:", colorYellow ), ParamStyle( "Chand Style", styleDashed ) );

_N( Title = EncodeColor( colorYellow ) + StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}}--Turtle_System_Rev_A \n OP= %g Hi= %g Lo= %g CL= %g (%.1f%%) \n Vol= " + WriteVal( V, 1.0 ) + "\n" + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );//=cnb

//_N(Title = "LLArray: " + LLArray + ", HHArray:" + HHArray +", stopArray"+stopArray);

//PlotShapes(shapeCircle * Sell, colorRed);
//PlotShapes(shapeCircle * Cover, colorGreen);
_SECTION_END();
 
2 ways for you to do it:
a. Ask someone to write the GFX horizontal line. OR
b. Cut & paste the plot & plotgrid to superimpose both lines


Too troublesome for programmer.

I just need to write the GFX horizontal line in a simple manner will do.

Sorry, you want then upgrade your software
I have access to 5.8 - please guide now...
 

amsin21

Well-Known Member
Re: Trades start and end with today's day validity

I require AFL for below condition

buy = c>ma(H,30) with only today validity,

Please help..
Bro, as I highlighted in your own thread, instead of copy & paste or posting for own focus in crowd, yasu222's thread , try to focus on one thread which focus on helping others request, this thread, as you did now. Good change...at least for a request...

For your answer, it should be Buy = Cross(C,MA( High, 30)), which defines a cross on the time frame applied, as per your requirement : Close > High of last 30 periods.
 
I have this afl which shows pivot,s/r, current and previous day low and high for all days. I need this, pivot,s/r, current and previous day low, appear for current day only. How to hide for previous days? I tried but not successful. Seniors kindly help


_SECTION_BEGIN("Price");
SetChartBkGradientFill( ParamColor("BgTop",colorBlack),ParamColor("BgBottom",colorBlack),ParamColor("Titleblock",colorLightGrey));
SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle);
GraphXSpace = 5;
Plot(C,"",colorWhite,styleCandle);
_SECTION_END();

//Previous Days HI LO //

DayH = TimeFrameGetPrice("H", inDaily, -1); DayHI = LastValue (DayH,1);// yesterdays high
DayL = TimeFrameGetPrice("L", inDaily, -1); DayLI = LastValue (DayL,1); // yesterdays low
DayC = TimeFrameGetPrice("C", inDaily, -1); // yesterdays close
DayO = TimeFrameGetPrice("O", inDaily); // current day open
DayH2= TimeFrameGetPrice("H", inDaily, -2); DayH2I = LastValue (DayH2,1); // Two days before high
DayL2= TimeFrameGetPrice("L", inDaily, -2); DayL2I = LastValue (DayL2,1); // Two days before low
DayH3= TimeFrameGetPrice("H", inDaily, -3); DayH3I = LastValue (DayH3,1); // Three days before high
DayL3= TimeFrameGetPrice("L", inDaily, -3); DayL3I = LastValue (DayL3,1); // Three days before low

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

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

TDBHL = ParamToggle("2/3Days before HI LO","Show|Hide",0);
if(TDBHL==1) {
Plot(DayL2,"2DBL",colorTurquoise,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(DayH2,"2DBH",colorTurquoise,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(DayL3,"3DBL",colorTurquoise,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(DayH3,"3DBH",colorTurquoise,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
PlotText(" 2DBH " , LastValue(BarIndex())-(numbars/Hts), DayH2I, colorTurquoise);
PlotText(" 2DBL " , LastValue(BarIndex())-(numbars/Hts), DayL2I, colorTurquoise);
PlotText(" 3DBH " , LastValue(BarIndex())-(numbars/Hts), DayH3I, colorTurquoise);
PlotText(" 3DBL " , LastValue(BarIndex())-(numbars/Hts), DayL3I, colorTurquoise);
}

// Pivot Levels //
PP = (DayL + DayH + DayC)/3; PPI = LastValue (PP,1); // Pivot
R1 = (PP * 2) - DayL; R1I = LastValue (R1,1); // Resistance 1
S1 = (PP * 2) - DayH; S1I = LastValue (S1,1); // Support 1
R2 = PP + R1 - S1; R2I = LastValue (R2,1); // Resistance 2
S2 = PP - R1 + S1; S2I = LastValue (S2,1); // Support 2
R3 = PP + R2 - S1; R3I = LastValue (R3,1); // Resistance 3
S3 = PP - R2 + S1; S3I = LastValue (S3,1); // Support 3

ppl = ParamToggle("Pivot Levels","Show|Hide",1);
if(ppl==1) {
Plot(PP, "PP",colorYellow,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(R1, "R1",colorViolet,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(S1, "S1",colorViolet,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(R2, "R2",colorViolet,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(S2, "S2",colorViolet,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(R3, "R3",colorViolet,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(S3, "S3",colorViolet,styleDots|styleNoLine|styleNoRescale|styleNoTitle);

PlotText(" Pivot ", LastValue(BarIndex())-(numbars/Hts), PPI, colorYellow);
PlotText(" R1 " , LastValue(BarIndex())-(numbars/Hts), R1I, colorViolet);
PlotText(" S1 " , LastValue(BarIndex())-(numbars/Hts), S1I, colorViolet);
PlotText(" R2 " , LastValue(BarIndex())-(numbars/Hts), R2I, colorViolet);
PlotText(" S2 " , LastValue(BarIndex())-(numbars/Hts), S2I, colorViolet);
PlotText(" R3 " , LastValue(BarIndex())-(numbars/Hts), R3I, colorViolet);
PlotText(" S3 " , LastValue(BarIndex())-(numbars/Hts), S3I, colorViolet);
}
// Camerilla Levels //

rg = (DayH - DayL);

H5=DayC+1.1*rg; H5I = LastValue (H5,1);
H4=DayC+1.1*rg/2; H4I = LastValue (H4,1);
H3=DayC+1.1*rg/4; H3I = LastValue (H3,1);
H2=DayC+1.1*rg/6; H2I = LastValue (H2,1);
H1=DayC+1.1*rg/12; H1I = LastValue (H1,1);
L1=DayC-1.1*rg/12; L1I = LastValue (L1,1);
L2=DayC-1.1*rg/6; L2I = LastValue (L2,1);
L3=DayC-1.1*rg/4; L3I = LastValue (L3,1);
L4=DayC-1.1*rg/2; L4I = LastValue (L4,1);
L5=DayC-1.1*rg; L5I = LastValue (L5,1);

pcl = ParamToggle("Camerilla Levels","Show|Hide",0);
if(pcl==1) {
Plot(H5,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(H4,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(H3,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(H2,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(H1,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(L1,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(L2,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(L3,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(L4,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Plot(L5,"",colorRose,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
PlotText(" H5 = " , LastValue(BarIndex())-(numbars/Hts), H5I +0.05, colorRose);
PlotText(" H4 = " , LastValue(BarIndex())-(numbars/Hts), H4I +0.05, colorRose);
PlotText(" H3 = " , LastValue(BarIndex())-(numbars/Hts), H3I +0.05, colorRose);
PlotText(" H2 = " , LastValue(BarIndex())-(numbars/Hts), H2I +0.05, colorRose);
PlotText(" H1 = " , LastValue(BarIndex())-(numbars/Hts), H1I +0.05, colorRose);
PlotText(" L1 = " , LastValue(BarIndex())-(numbars/Hts), L1I +0.05, colorRose);
PlotText(" L2 = " , LastValue(BarIndex())-(numbars/Hts), L2I +0.05, colorRose);
PlotText(" L3 = " , LastValue(BarIndex())-(numbars/Hts), L3I +0.05, colorRose);
PlotText(" L4 = " , LastValue(BarIndex())-(numbars/Hts), L4I +0.05, colorRose);
PlotText(" L5 = " , LastValue(BarIndex())-(numbars/Hts), L5I +0.05, colorRose);
}

// Current Days Hi Lo //
THL = ParamToggle("Todays Hi Lo","Show|Hide",1);
if(THL==1) {
isRth = TimeNum() >= 084500 & TimeNum() <= 085959;
isdRth = TimeNum() >= 084500 & TimeNum() <= 160000;
aRthL = IIf(isRth, L, 1000000);
aRthH = IIf(isdRth, H, Null);
aRthLd = IIf(isdRth, L, 1000000);
DayH = TimeFrameCompress( aRthH, inDaily, compressHigh );
DayH = TimeFrameExpand( DayH, inDaily, expandFirst );
DayL = TimeFrameCompress( aRthLd, inDaily, compressLow );
DayL = TimeFrameExpand( DayL, inDaily, expandFirst );
Bars = BarsSince(TimeNum() >= 94500 AND TimeNum() < 095959);//,BarIndex(),1); // AND DateNum()==LastValue(DateNum());
x0 = BarCount-LastValue(Bars);
x1 = BarCount-1;
DayHline=LineArray(x0,LastValue(DayH),x1,LastValue (DayH),0);
DayLline=LineArray(x0,LastValue(DayL),x1,LastValue (DayL),0);
DayHlineI = LastValue (DayHline,1);
DayLlineI = LastValue (DayLline,1);
Plot(DayHline,"DayH",colorYellow,styleBar|styleNoRescale|styleNoTitle);
Plot(DayLline,"DayL",colorYellow,styleBar|styleNoRescale|styleNoTitle);
PlotText(" Day Hi " , LastValue(BarIndex())-(numbars/Hts), DayHlineI +0.05, colorYellow);
PlotText(" Day Lo " , LastValue(BarIndex())-(numbars/Hts), DayLlineI +0.05, colorYellow);
}
 
i need candle stick pattern identification for only bullish engulfing and bearish engulfing .

need an afl which plots the same on chart so that i cud do some visual back testing .



regards
 

Similar threads