Need afl for AHR-ADR-AWR

rvlv

Active Member
#12
Dear HULK

Thanks for your adr code.
Thanks to ford for initiating the topic,it works in real markets.

but there is a small correction
can you please incorporate the following and name the new afl as ADRweighted
--------------------------------------

the concept is

It computes yesterday's range (range= high - low),
the previous 5, 10 and 20 days ranges.
And it calculates the "Average Day Range" of these four ranges (yesterday's+ Prev 5 Day Range + Prev 10 Day Range + Prev 20 Day Range)/4.
So, if yesterday's Day Range was 80, the Previous 5 Day Range was 110, the Previous 10 Day Range was 90 and the Previous 20 Day Range was 120, then the Average Day Range would be 100.
ADR is therefore a kind of weighted Day Range.

the trading method is just wait for price to breakout above weadrhi or weadrlow on a price chart and go with tight stoploss.

some hint
------------------------------------------------------------
double AvgDayRange(int nth_day)
{
double R1,R5,R10,R20;
int i;

R1 = (iHigh(NULL,PERIOD_D1,nth_day)-iLow(NULL,PERIOD_D1,nth_day));
for(i=0;i<5;i++) R5 = R5 + (iHigh(NULL,PERIOD_D1,nth_day+i)-iLow(NULL,PERIOD_D1,nth_day+i));
for(i=0;i<10;i++) R10 = R10 + (iHigh(NULL,PERIOD_D1,nth_day+i)-iLow(NULL,PERIOD_D1,nth_day+i));
for(i=0;i<20;i++) R20 = R20 + (iHigh(NULL,PERIOD_D1,nth_day+i)-iLow(NULL,PERIOD_D1,nth_day+i));

R5 = R5/5;
R10 = R10/10;
R20 = R20/20;

return((R1+R5+R10+R20)/4);

-------------------------------------------------------------
Hope you find time to do something for this request.

regards
rvlv
 

HULK

Active Member
#13
Dear HULK

Thanks for your adr code.
Thanks to ford for initiating the topic,it works in real markets.

but there is a small correction
can you please incorporate the following and name the new afl as ADRweighted
--------------------------------------

the concept is

It computes yesterday's range (range= high - low),
the previous 5, 10 and 20 days ranges.
And it calculates the "Average Day Range" of these four ranges (yesterday's+ Prev 5 Day Range + Prev 10 Day Range + Prev 20 Day Range)/4.
So, if yesterday's Day Range was 80, the Previous 5 Day Range was 110, the Previous 10 Day Range was 90 and the Previous 20 Day Range was 120, then the Average Day Range would be 100.
ADR is therefore a kind of weighted Day Range.

the trading method is just wait for price to breakout above weadrhi or weadrlow on a price chart and go with tight stoploss.

some hint
------------------------------------------------------------
double AvgDayRange(int nth_day)
{
double R1,R5,R10,R20;
int i;

R1 = (iHigh(NULL,PERIOD_D1,nth_day)-iLow(NULL,PERIOD_D1,nth_day));
for(i=0;i<5;i++) R5 = R5 + (iHigh(NULL,PERIOD_D1,nth_day+i)-iLow(NULL,PERIOD_D1,nth_day+i));
for(i=0;i<10;i++) R10 = R10 + (iHigh(NULL,PERIOD_D1,nth_day+i)-iLow(NULL,PERIOD_D1,nth_day+i));
for(i=0;i<20;i++) R20 = R20 + (iHigh(NULL,PERIOD_D1,nth_day+i)-iLow(NULL,PERIOD_D1,nth_day+i));

R5 = R5/5;
R10 = R10/10;
R20 = R20/20;

return((R1+R5+R10+R20)/4);

-------------------------------------------------------------
Hope you find time to do something for this request.

regards
rvlv
Rvlv

I got ur concept my small query for you, as you had mentioned that you are looking for weighted Day Range = ( 80 + 110 + 90 + 120 ) / 4 = 100

Now this example we take this for nifty now tell me will you wait in intraday nifty move up/down 100 point then u take ur call and as you had mentioned you follow strict sl so what would be your sl for this case.


HULK
 

rvlv

Active Member
#14
Dear HULK

Thanks.
please note two things.

Main thing
track price on a significant timeframe with adr hi and adr low lines.
trade when price breaks above adrhi line with tight stoploss as per your testing and observation.
a tight stoploss in my view is 0.10*ATR(20)
but with your tests and observations if you feel 0.5*ATR20 gives better stand,go with it.

When I calculate ADR average value,I know what could be average.
if i find it moved today already 40 units we can expect another 60 unit move.
technically what we do is this.
for scalping etc, we mark 80% range close to adr hi and adr lo. these are zones where price can turn in rangebound moves.

i dont wait much.

when price meets adr low line,it is a signal that price may go two ways.
one is in strong trends it can move by breakout for target of adr range average from breakout point.second is it reverses and proceeds to other end from hi to lo or lo to high.
when price meets adrhi ,it means now a breakout up or reversal is possible.if breakout
stoploss is purely function of your risk tolerance.
as per grandpa jimberg ,you need 2*atr15 below entry or above entry on daily timeframe.
prorate this to your timeframe to get lower setting.then test it-300 trades must use ami to test.if more than 65% are ok,then it is fine.

one more thing
--------------------------------------------------
In forex they use a stoploss based on adr range.
http://forex-strategies-revealed.com/simple/trading-average-daily-range

50 pip profit target, 25 pip stoploss if ADR Above 200
40 pip profit target, 20 pip stoploss if ADR BETWEEN 175 and 199
30 pip profit target, 15 pip stoploss if ADR BELOW 175

Do not trade if ADR is below 100
-------------------------------------------
again the range and stoploss figures vary based on timeframe.

that is it

regards
rvlv
 
Last edited:

rvlv

Active Member
#15
Dear HULK

Please post the afl code for the weighted adr when you find time.
then I will test it.

one idea of having ADR average range on price chart is to be able to see if there is a choppy zone or not,if choppy zone exists just dont trade till range exceeds minimum set value which may be 25% of normally good adr range.
.
regards
rvlv
 
Last edited:

HULK

Active Member
#16
Dear HULK

Please post the afl code for the weighted adr when you find time.
then I will test it.

one idea of having ADR average range on price chart is to be able to see if there is a choppy zone or not,if choppy zone exists just dont trade till range exceeds minimum set value which may be 25% of normally good adr range.
.
regards
rvlv
rvlv

Try this

HD1 = TimeFrameGetPrice("H", inDaily, -1);
LD1 = TimeFrameGetPrice("L", inDaily, -1);
M1 = HD1 - LD1;//THIS WILL GIVE YOU 1 DAY ADR

HD2 = TimeFrameGetPrice("H", inDaily, -2);
LD2 = TimeFrameGetPrice("L", inDaily, -2);
M2 = HD2 - LD2;

HD3 = TimeFrameGetPrice("H", inDaily, -3);
LD3 = TimeFrameGetPrice("L", inDaily, -3);
M3 = HD3 - LD3;

HD4 = TimeFrameGetPrice("H", inDaily, -4);
LD4 = TimeFrameGetPrice("L", inDaily, -4);
M4 = HD4 - LD4;

HD5 = TimeFrameGetPrice("H", inDaily, -5);
LD5 = TimeFrameGetPrice("L", inDaily, -5);
M5 = HD5 - LD5;

AD5 = (M1+M2+M3+M4+M5)/5; // This will give you 5 Days ADR

Like this keep adding loop for 10 days(AD10) then 20 days (AD20)

then add line

WDR = (M1+AD5+AD10+AD20)/4;// THIS WILL GIVE YOU WDR


Plot(WDR,"",colorBlue,styleDots+styleThick);//NOW PLOT WDR

FOR SL YOU KNOW THE CODE

ENJOY :thumb:

NOTE :- ONCE YOU FINISH THIS CODE SHARE HERE FOR ALL

HULK
 
#17
I want combine two afl.

One afl is candalstick chart with Buy Sell Signal.

Afl is belowe.

_SECTION_BEGIN("Ensign Volatility Stop");

// Ensign Volatility Stop
// get the multiple of 9 period EMA of ATR_Ensign

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
k=Param("multiplication factor", 1,0.5,5,0.1);

period=k*5;
VS_raw = 2.2 * EMA(ATR(1), period);

// for longs, VS line is below price
loline = VS_below_price = HHV(Close, period) - VS_raw;

// for shorts, VS line is above price
hiline = VS_above_price = LLV(Close, period) + VS_raw;
between = IIf (C < hiline AND C > loline, 1, 0);
up = IIf(C > hiline OR (H > Ref(H, -1) AND H > hiline), 1, 0);
dn = IIf(C < loline OR (L < Ref(L, -1) AND L < loline), 1, 0);
upcond = IIf(between AND BarsSince(up) < BarsSince(dn) , 1, 0);
dncond = IIf(between AND BarsSince(dn) < BarsSince(up) , 1, 0);
upline = IIf(up OR upcond, loline, Null);
dnline = IIf(dn OR dncond, hiline, Null);

Buy=upline;
Sell=dnline;

Col = IIf(Buy,colorGreen,IIf(Sell,colorRed,colorBlack));

Plot(C, "", col, styleBar | styleThick );

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

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorBrightGreen, colorRed ),0, IIf( Buy, Low, High ) );


Second afl is SUPPORT AND RESISTANCE These afl is show All support and Resistance.

The afl is below

//|-----------------------------------------------------------------------------------------
//|PatternExplorer.com - Support & Resistance
//|Copyright 2007, PatternExplorer.com
//|http://www.PatternExplorer.com
//|e-mail: [email protected]
//|-----------------------------------------------------------------------------------------
FormulaName = "PE - S & R";

SetChartOptions( 0, chartShowDates | chartLogarithmic | chartWrapTitle );
#pragma nocache
#include_once <\PEInc\PatternExplorer_f0.afl>
#include_once "Formulas\PatternExplorer\#Defaults & Mods\PE - Defaults.afl"
#include_once "Formulas\PatternExplorer\#Defaults & Mods\PE - Mods.afl"
/************************************************** *****************************************/
AddCustomCodeBeforePE();
/************************************************** *****************************************/

_SECTION_BEGIN( "Main Parameters" );
AddparamUsefromChart( def_UseFromChart );
Sensitivity = Param( "Sensitivity", 10, 0, 100, 1 );

if ( InChart )
StaticVarSet( "FYIOKU", Sensitivity );

if ( inAA AND Usefromchart )
Sensitivity = StaticVarGet( "FYIOKU" );

DisRange = Param( "Plot 'far away' Lines Trigger", 3, 0, 10, 0.5 );

Color_SL = ParamColor( "Support", def_Color1 );

Color_RL = ParamColor( "Resistance", colorRed );

_SECTION_END();

/************************************************** *****************************************/
#include_once <\PEInc\PatternExplorer_1.afl>
#include_once <\PEInc\Lib\PatternExplorer_f15.afl>
/************************************************** *****************************************/
BS = break_G1_val == 1 OR break_G2_val == 1;

SS = break_G1_val == -1 OR break_G2_val == -1;

Buy = def_Buy AND BS;

Sell = SS;

/************************************************** *****************************************/
Filter = def_Filter AND BarIndex() == LastValue( BarIndex() ) AND NOT GroupID() == 253;

Filter = Filter AND ( Buy OR Sell );

/************************************************** *****************************************/
Addefaultcolumns();

Adddefaultcolumns( 2, 1 );

AddTextColumn(
WriteIf( break_G1_val == -1, "Break",
WriteIf( break_G1_val == 1, "Break", "" ) ), "Minor Levels", 1.2,
IIf( break_G1_val == 1, colorGreen, IIf( break_G1_val == -1, colorRed, colorBlue ) ) );

AddTextColumn(
WriteIf( break_G2_val == -1, "Break",
WriteIf( break_G2_val == 1, "Break", "" ) ), "Major Levels", 1.2,
IIf( break_G2_val == 1, colorGreen, IIf( break_G2_val == -1, colorRed, colorBlue ) ) );

AddTextColumn( FullName(), "Full name" );

/************************************************** *****************************************/
Plot( IIf( x >= XT1 & RT1 &NOT T1 == 0, T1, -1e10 ), "T1", IIf( LastValue( C ) < T1, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XT2 & RT2 &NOT T2 == 0, T2, -1e10 ), "T2", IIf( LastValue( C ) < T2, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XT3 & RT3 &NOT T3 == 0, T3, -1e10 ), "T3", IIf( LastValue( C ) < T3, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XT4 & RT4 &NOT T4 == 0, T4, -1e10 ), "T4", IIf( LastValue( C ) < T4, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XT5 & RT5 &NOT T5 == 0, T5, -1e10 ), "T5", IIf( LastValue( C ) < T5, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XP1 & RP1 &NOT P1 == 0, P1, -1e10 ), "P1", IIf( LastValue( C ) < P1, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XP2 & RP2 &NOT P2 == 0, P2, -1e10 ), "P2", IIf( LastValue( C ) < P2, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XP3 & RP3 &NOT P3 == 0, P3, -1e10 ), "P3", IIf( LastValue( C ) < P3, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XP4 & RP4 &NOT P4 == 0, P4, -1e10 ), "P4", IIf( LastValue( C ) < P4, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XP5 & RP5 &NOT P5 == 0, P5, -1e10 ), "P5", IIf( LastValue( C ) < P5, Color_RL, Color_SL ), 1 + 2048 + styleNoTitle );

Plot( IIf( x >= XT6 & RT6 &NOT T6 == 0, T6, -1e10 ), "T6", IIf( LastValue( C ) < T6, Color_RL, Color_SL ), 8 + 2048 + styleNoTitle );

Plot( IIf( x >= XT7 & RT7 &NOT T7 == 0, T7, -1e10 ), "T7", IIf( LastValue( C ) < T7, Color_RL, Color_SL ), 8 + 2048 + styleNoTitle );

Plot( IIf( x >= XP6 & RP6 &NOT P6 == 0, P6, -1e10 ), "P6", IIf( LastValue( C ) < P6, Color_RL, Color_SL ), 8 + 2048 + styleNoTitle );

Plot( IIf( x >= XP7 & RP7 &NOT P7 == 0, P7, -1e10 ), "P7", IIf( LastValue( C ) < P7, Color_RL, Color_SL ), 8 + 2048 + styleNoTitle );

/************************************************** *****************************************/
ToolTip = def_ToolTip;

/************************************************** *****************************************/
AddCustomCodeAfterPE();

/************************************************** *****************************************/
Title = "PatternExplorer.com - Support & Resistance" + default_priceTitle + EncodeColor( IIf( NOT AnZ, def_Text2, colorRed ) ) + ",Sensitivity = " + WriteVal( Sensitivity, 1 ) + " " + EncodeColor( colorRed ) + WriteIf( NOT AnZ, "", " NO POINTS AVAILABLE -> REDUCE SENSITIVITY " );


Any one can combine these two afl.
If price is 5200 on bar chart.
Support is 5100 and resitance is 5400.
i want support resistance price on bar chart.
Support means stop loss and resitance means target.
Means current nifty trade 5200 stop loss is 5100 and target is 5400.
these information is show on bar chart without support and resitance chart.

If any one can do these pls try.

Thanks
 

rvlv

Active Member
#18
hi
keep your first ready with stoploss

go to
view-charts-patternexplorer-support resistance
click on s&r ,drag it onto your other chart
both get combined
that is it.
 
#19
Need your help to improve afl code...

Now in case if want weekly high / low change ysday code to

Hello HULK Sir,
I am following yours msg and post from long time and understood that you all are having good knowledge of afl and coding.

I need your help...I will be very thankful if you can sort it out...

I have one afl (amibroker)...It is giving Buy/sell signal as Up or Down Arrow....I want "Strong Buy @ 0000" or "Strong Sell @ 0000" on chart above and below BUY / SELL Up or Down arrow..( here 0000 is a Current Price on which signal will generate).

Can you modify the code and insert these messages into code and re-post to me ???

Kindly read last six line from the code below...where I have mentioned my requirement.

Thanks in Advance.

Bhupesh :)



Here is a code.



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 )) ));
//Plot( C, "Close", ParamColor("Color", colorWhite ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Plot(C,"",colorRose, styleCandle );
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 )));
}


SL = ( HHV( H, 26 ) + LLV( L, 26) )/2; // standard, base, or kijun-sen line
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2; // turning, conversion, or tenkan-sen line
DL = Ref( C, 26 ); // delayed close price, or chikou span
Span1 = Ref( ( SL + TL )/2, -25 ); //Span1 and Span2 define the clouds
Span2 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);
/*
SL = ( HHV( H, 26 ) + LLV( L, 26) )/2;
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2;
DL = Ref( C, 26 );
Span1 = (( SL + TL )/2);
Span2 = (HHV( H, 52) + LLV(L, 52))/2;
*/
hue = Param("Hue",140,0,255,1);
sat = Param("Sat",100,0,255,1);
bri = Param("bri",220,0,255,1);

Plot(SL,"SL",colorBlue,styleThick); // standard, base, or kijun-sen line
Plot(TL,"TL",colorRed,styleThick); // turning, conversion, or tenkan-sen line
Plot(DL,"DL",colorLime ,styleThick); // delayed, lagging, or chikou span
//Plot(Span1,"",colorGreen,1,0,0,26); // senkou span A, kumo, or white clouds
//Plot(Span2,"",colorSeaGreen,1,0,0,26); // senkou span B, kumo, or white clouds
PlotOHLC(Span1,Span1,Span2,Span2,"Cloud",ColorHSB( Hue,sat,bri),styleCloud);
//PlotOHLC(Span1,Span2,Span1,Span2,"",IIf(Span1>Span 2,8,9),styleCloud|4096,0,0,26);

Buy = Cross(TL,SL);
Sell = Cross(SL,TL);
shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
PlotShapes(shape,IIf(Buy,colorDarkGreen,colorRed), 0,IIf(Buy,Low,High));

above = IIf(TL>Span1 AND TL>Span2,1,0);
within = IIf(TL>Span1 AND TL<Span2,1,0);
below = IIf(TL<Span1 AND TL<Span2,1,0);
Buy = Cross(TL,SL) AND (DL>Close);
Sell = Cross(SL,TL) AND (DL<SL);
StrongBuy = Buy AND above;
MediumBuy = Buy AND within;
WeakBuy = Buy AND below;
StrongSell = Sell AND below;
MediumSell = Sell AND within;
WeakSell = Sell AND above;

IIf( (StrongBuy),PlotShapes(shapeUpTriangle*StrongBuy, colorGreen),0); // I want to show msg Strong Buy @ (price) Here wit Arrow
IIf( (MediumBuy),PlotShapes(shapeUpArrow*MediumBuy,colorGreen),0); // I want to show msg Medium Buy @ (price) Here wit Arrow
IIf( (WeakBuy),PlotShapes(shapeHollowUpArrow*WeakBuy,colorIndigo),0); // I want to show msg Weak Buy @ (price) Here wit Arrow
IIf( (StrongSell),PlotShapes(shapeDownTriangle*StrongSell,colorRed),0);// I want to show msg Strong Sell @ (price) Here wit Arrow
IIf( (MediumSell),PlotShapes(shapeDownArrow*MediumSell, colorRed),0); // I want to show msg Medium Sell @ (price)Here wit Arrow
IIf( (WeakSell),PlotShapes(shapeHollowDownArrow*WeakSell,colorBrown),0);// I want to show msg Weak Sell @ (price)Here wit Arrow
 

HULK

Active Member
#20
Re: Need your help to improve afl code...

Now in case if want weekly high / low change ysday code to

Hello HULK Sir,
I am following yours msg and post from long time and understood that you all are having good knowledge of afl and coding.

I need your help...I will be very thankful if you can sort it out...

I have one afl (amibroker)...It is giving Buy/sell signal as Up or Down Arrow....I want "Strong Buy @ 0000" or "Strong Sell @ 0000" on chart above and below BUY / SELL Up or Down arrow..( here 0000 is a Current Price on which signal will generate).

Can you modify the code and insert these messages into code and re-post to me ???

Kindly read last six line from the code below...where I have mentioned my requirement.

Thanks in Advance.

Bhupesh :)



Here is a code.



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 )) ));
//Plot( C, "Close", ParamColor("Color", colorWhite ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Plot(C,"",colorRose, styleCandle );
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 )));
}


SL = ( HHV( H, 26 ) + LLV( L, 26) )/2; // standard, base, or kijun-sen line
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2; // turning, conversion, or tenkan-sen line
DL = Ref( C, 26 ); // delayed close price, or chikou span
Span1 = Ref( ( SL + TL )/2, -25 ); //Span1 and Span2 define the clouds
Span2 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);
/*
SL = ( HHV( H, 26 ) + LLV( L, 26) )/2;
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2;
DL = Ref( C, 26 );
Span1 = (( SL + TL )/2);
Span2 = (HHV( H, 52) + LLV(L, 52))/2;
*/
hue = Param("Hue",140,0,255,1);
sat = Param("Sat",100,0,255,1);
bri = Param("bri",220,0,255,1);

Plot(SL,"SL",colorBlue,styleThick); // standard, base, or kijun-sen line
Plot(TL,"TL",colorRed,styleThick); // turning, conversion, or tenkan-sen line
Plot(DL,"DL",colorLime ,styleThick); // delayed, lagging, or chikou span
//Plot(Span1,"",colorGreen,1,0,0,26); // senkou span A, kumo, or white clouds
//Plot(Span2,"",colorSeaGreen,1,0,0,26); // senkou span B, kumo, or white clouds
PlotOHLC(Span1,Span1,Span2,Span2,"Cloud",ColorHSB( Hue,sat,bri),styleCloud);
//PlotOHLC(Span1,Span2,Span1,Span2,"",IIf(Span1>Span 2,8,9),styleCloud|4096,0,0,26);

Buy = Cross(TL,SL);
Sell = Cross(SL,TL);
shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
PlotShapes(shape,IIf(Buy,colorDarkGreen,colorRed), 0,IIf(Buy,Low,High));

above = IIf(TL>Span1 AND TL>Span2,1,0);
within = IIf(TL>Span1 AND TL<Span2,1,0);
below = IIf(TL<Span1 AND TL<Span2,1,0);
Buy = Cross(TL,SL) AND (DL>Close);
Sell = Cross(SL,TL) AND (DL<SL);
StrongBuy = Buy AND above;
MediumBuy = Buy AND within;
WeakBuy = Buy AND below;
StrongSell = Sell AND below;
MediumSell = Sell AND within;
WeakSell = Sell AND above;

IIf( (StrongBuy),PlotShapes(shapeUpTriangle*StrongBuy, colorGreen),0); // I want to show msg Strong Buy @ (price) Here wit Arrow
IIf( (MediumBuy),PlotShapes(shapeUpArrow*MediumBuy,colorGreen),0); // I want to show msg Medium Buy @ (price) Here wit Arrow
IIf( (WeakBuy),PlotShapes(shapeHollowUpArrow*WeakBuy,colorIndigo),0); // I want to show msg Weak Buy @ (price) Here wit Arrow
IIf( (StrongSell),PlotShapes(shapeDownTriangle*StrongSell,colorRed),0);// I want to show msg Strong Sell @ (price) Here wit Arrow
IIf( (MediumSell),PlotShapes(shapeDownArrow*MediumSell, colorRed),0); // I want to show msg Medium Sell @ (price)Here wit Arrow
IIf( (WeakSell),PlotShapes(shapeHollowDownArrow*WeakSell,colorBrown),0);// I want to show msg Weak Sell @ (price)Here wit Arrow

ADD following code

WriteIf (StrongBuy , EncodeColor(colorGreen)+ "Strong Buy / GO LONG at "+C+" ","")+
WriteIf (MediumBuy, EncodeColor(colorYellow)+ " MediumBuy at "+C+" ","")+

like this you can add for sell code

Enjoy :cheers:

HULK
 

Similar threads