Hello Experts
Request help for AFL for displaying stocks who's CLOSE is above multiple EMA's and MA's on daily, weekly and monthly timeframe. Below is an AFL (which i started coding on Dly timeframe - being a novice) which should give SripName in the EXPLORE for all stocks close > EMA 5,10,20,50 & MA100,200. Strangely, it is not being shown. Also another problem is that it is showing output of stocks who Closing price is < 1 Rupee ...
Say for example, as of now - 28Jul2017 closing, HDFC close is above EMA 5,10,20,50 and MA 100,200 on all timeframes (Dly & Wkly & Mnthly). But the same is not coming in the Explore output.
Attaching all screenshots for reference.
Can someone please help to code the requirement please ?
Requesting a code which will display all stocks to be shown who's CLOSE is above EMA 5,10,20,50 and MA100,200 on all timeframes - Daily, Weekly & Monthly
(Have attached the files of Explore output and HDFC Chart on multiple timeframes)
Below is the code which I had written - as a starting point. Please help by modifying the same
_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", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA4");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("MA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
//_SECTION_BEGIN("MA_Buy-Sell");
//M100=MA(C,100);
//M200=MA(C,200);
COND1 = EMA(C,5) AND EMA(C,10) AND EMA(C,20) AND EMA(C,50) AND MA(C,100) AND MA(C,200);
BuyCond= EMA(C,5) > EMA(C,10)> EMA(C,20) > EMA(C,50) > MA(C,100) > MA(C,200);
SellCond= EMA(C,5) < EMA(C,10) < EMA(C,20) < EMA(C,50) < MA(C,100) < MA(C,200);
MA_BUY=IIf((C > COND1) AND (BuyCond==True),1,0);
MA_SELL=IIf((C < COND1) AND (SellCond==True),1,0);
Filter = MA_Buy OR MA_Sell;
AddColumn(Close,"Close");
BuySig = IIf((MA_buy) == True, 1, 0) ;
SellSig = IIf((MA_sell) == True, 1, 0);
AddColumn(BuySig,"Buy", format = 1.2, IIf(BuySig, Textcolor = colorGreen, textcolor = colorWhite));
AddColumn(SellSig,"Sell", format = 1.2, IIf(SellSig, Textcolor = colorRed, textcolor = colorWhite));
AddColumn(EMA(C,5),"EMA5");
AddColumn(EMA(C,10),"EMA10");
AddColumn(EMA(C,20),"MA100");
AddColumn(EMA(C,50),"MA100");
AddColumn(MA(C,100),"MA100");
AddColumn(MA(C,200),"MA200");
Request help for AFL for displaying stocks who's CLOSE is above multiple EMA's and MA's on daily, weekly and monthly timeframe. Below is an AFL (which i started coding on Dly timeframe - being a novice) which should give SripName in the EXPLORE for all stocks close > EMA 5,10,20,50 & MA100,200. Strangely, it is not being shown. Also another problem is that it is showing output of stocks who Closing price is < 1 Rupee ...
Say for example, as of now - 28Jul2017 closing, HDFC close is above EMA 5,10,20,50 and MA 100,200 on all timeframes (Dly & Wkly & Mnthly). But the same is not coming in the Explore output.
Attaching all screenshots for reference.
Can someone please help to code the requirement please ?
Requesting a code which will display all stocks to be shown who's CLOSE is above EMA 5,10,20,50 and MA100,200 on all timeframes - Daily, Weekly & Monthly
(Have attached the files of Explore output and HDFC Chart on multiple timeframes)
Below is the code which I had written - as a starting point. Please help by modifying the same
_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", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA4");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("MA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
//_SECTION_BEGIN("MA_Buy-Sell");
//M100=MA(C,100);
//M200=MA(C,200);
COND1 = EMA(C,5) AND EMA(C,10) AND EMA(C,20) AND EMA(C,50) AND MA(C,100) AND MA(C,200);
BuyCond= EMA(C,5) > EMA(C,10)> EMA(C,20) > EMA(C,50) > MA(C,100) > MA(C,200);
SellCond= EMA(C,5) < EMA(C,10) < EMA(C,20) < EMA(C,50) < MA(C,100) < MA(C,200);
MA_BUY=IIf((C > COND1) AND (BuyCond==True),1,0);
MA_SELL=IIf((C < COND1) AND (SellCond==True),1,0);
Filter = MA_Buy OR MA_Sell;
AddColumn(Close,"Close");
BuySig = IIf((MA_buy) == True, 1, 0) ;
SellSig = IIf((MA_sell) == True, 1, 0);
AddColumn(BuySig,"Buy", format = 1.2, IIf(BuySig, Textcolor = colorGreen, textcolor = colorWhite));
AddColumn(SellSig,"Sell", format = 1.2, IIf(SellSig, Textcolor = colorRed, textcolor = colorWhite));
AddColumn(EMA(C,5),"EMA5");
AddColumn(EMA(C,10),"EMA10");
AddColumn(EMA(C,20),"MA100");
AddColumn(EMA(C,50),"MA100");
AddColumn(MA(C,100),"MA100");
AddColumn(MA(C,200),"MA200");
Attachments
-
47.7 KB Views: 79
-
38.1 KB Views: 81
-
46.5 KB Views: 77
-
40.5 KB Views: 69