Simple Coding Help - No Promise.

Seniors plz help

i need a exploration for adx which can expoler the scripts

condition :
adx is below 20 for "n periods" ..

here periods can change thru parameter settings.
 

amitrandive

Well-Known Member
Seniors plz help

i need a exploration for adx which can expoler the scripts

condition :
adx is below 20 for "n periods" ..

here periods can change thru parameter settings.
Try this

Code:
_SECTION_BEGIN("ADX");
SetChartOptions(0,0,0,1,1);
range = Param("Periods", 14, 2, 200, 1 );
ad = ADX(range);
NT=ad<20;
Filter=NT; 
AddColumn(ad,"ADX",1.4,20);
_SECTION_END();
 
Last edited:
Respected Amismart

Thankssssssssss:clap::clapping:

Sir/Madam, Can u please help me below afl, we can attache this to turtle afl..

_SECTION_BEGIN("Moving Average");

x=Param("EMA 1",20,1,200,1);
y=Param("EMA 2", 50,1,200,1);
z=Param("EMA 3",100,1,200,1);
zz=Param("EMA 4",200,1,200,1);
EMA20= EMA(C,x);
EMA50=EMA(C,y);
EMA100= EMA(C,z);
EMA200=EMA(C,zz);

SUT=EMA(C,5)>EMA20;
SDT=EMA20>EMA(C,5);
mut= EMA20>EMA50;
mdt=EMA20<EMA50;
_SECTION_END();
_SECTION_BEGIN("Mid Term Price Trend");


MPT = IIf( mut, colorGreen, IIf( mdt, colorRed, colorYellow));
Plot( 3, "", MPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);

_SECTION_END();

_SECTION_BEGIN("Short Term Price Trend");

SPT = IIf( EMA(C,5)>EMA20, colorBrightGreen, IIf( EMA20>EMA(C,5), colorPink, colorYellow));
Plot( 6, "", SPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);

_SECTION_END();


above afl is shows short term & mid term trend,
Sir Can u fix it with LONG TERM TREND
i am not a afl writer ......


Warm Regards
Chinmay
 

amitrandive

Well-Known Member
Respected Amismart

Thankssssssssss:clap::clapping:

Sir/Madam, Can u please help me below afl, we can attache this to turtle afl..

_SECTION_BEGIN("Moving Average");

x=Param("EMA 1",20,1,200,1);
y=Param("EMA 2", 50,1,200,1);
z=Param("EMA 3",100,1,200,1);
zz=Param("EMA 4",200,1,200,1);
EMA20= EMA(C,x);
EMA50=EMA(C,y);
EMA100= EMA(C,z);
EMA200=EMA(C,zz);

SUT=EMA(C,5)>EMA20;
SDT=EMA20>EMA(C,5);
mut= EMA20>EMA50;
mdt=EMA20<EMA50;
_SECTION_END();
_SECTION_BEGIN("Mid Term Price Trend");


MPT = IIf( mut, colorGreen, IIf( mdt, colorRed, colorYellow));
Plot( 3, "", MPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);

_SECTION_END();

_SECTION_BEGIN("Short Term Price Trend");

SPT = IIf( EMA(C,5)>EMA20, colorBrightGreen, IIf( EMA20>EMA(C,5), colorPink, colorYellow));
Plot( 6, "", SPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);

_SECTION_END();


above afl is shows short term & mid term trend,
Sir Can u fix it with LONG TERM TREND
i am not a afl writer ......


Warm Regards
Chinmay
Use this
:thumb:

Code:
_SECTION_BEGIN("Moving Average");

x=Param("EMA 1",20,1,200,1);
y=Param("EMA 2", 50,1,200,1);
z=Param("EMA 3",100,1,200,1);
zz=Param("EMA 4",200,1,200,1);
EMA20= EMA(C,x);
EMA50=EMA(C,y);
EMA100= EMA(C,z);
EMA200=EMA(C,zz);

SUT=EMA(C,5)>EMA20;
SDT=EMA20>EMA(C,5);
mut= EMA20>EMA50;
mdt=EMA20<EMA50;
LUT=EMA50>EMA200;
LDT=EMA200>EMA50;
_SECTION_END();
_SECTION_BEGIN("Mid Term Price Trend");


MPT = IIf( mut, colorGreen, IIf( mdt, colorRed, colorYellow));
Plot( 3, "", MPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);

_SECTION_END();

_SECTION_BEGIN("Short Term Price Trend");

SPT = IIf( EMA(C,5)>EMA20, colorBrightGreen, IIf( EMA20>EMA(C,5), colorPink, colorYellow));
Plot( 6, "", SPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);

_SECTION_END();

_SECTION_BEGIN("Long Term Price Trend");

LPT = IIf( EMA(C,50)>EMA200, colorAqua, IIf( EMA200>EMA(C,50), colorOrange, colorYellow));
Plot( 9, "", LPT, styleArea|styleOwnScale|styleNoLabel, 0, 100);

_SECTION_END();
 

Similar threads