long (1hour) & short(5 & 15 min) term trend show in this afl

Abhi1284

Active Member
#1
_SECTION_BEGIN("Vol-Trend");
uptrend=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
downtrend=MDI(10)>PDI(20)AND Signal(29)>MACD(13);

Plot( 5, /* defines the height of the ribbon in percent of pane width */"",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleHistogram+styleThick|styleNoLabel, -0.5, 100 );
Plot( 6,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,-0.5, 100 );

uptrend=PDI()>MDI() AND MACD()>Signal() AND (ADX()>20);
downtrend=MDI()>PDI() AND Signal()>MACD();
_SECTION_END();


Dear senior
Pls help me to show hourly & 15 min trend in this afl

Thanx
Abhishek
 

sr114

Well-Known Member
#2
_SECTION_BEGIN("Vol-Trend");
uptrend=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
downtrend=MDI(10)>PDI(20)AND Signal(29)>MACD(13);

Plot( 5, /* defines the height of the ribbon in percent of pane width */"",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleHistogram+styleThick|styleNoLabel, -0.5, 100 );
Plot( 6,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,-0.5, 100 );

uptrend=PDI()>MDI() AND MACD()>Signal() AND (ADX()>20);
downtrend=MDI()>PDI() AND Signal()>MACD();
_SECTION_END();


Dear senior
Pls help me to show hourly & 15 min trend in this afl

Thanx
Abhishek
use the time frame function to define pdi and mdi in 15 min and hourly respectively. then plot the respective 5min pdi and mdi and 15 min pdi and mdi in the ribbons to get the proper stuff

flow diagram

Code:
 tf=Param("Time Frame (min)",5,0.0001,100000,1);

 tfrm5=in1Minute*15;
 uptrend1 = pdi > mdi and macd > macd sig
 dntrend1 = pdi < mdi and macd < macd sig
 TimeFrameRestore();

 
 tfrmhr=in1Minute*60; or inhourly
 uptrend1 = pdi > mdi and macd > macd sig
 dntrend1 = pdi < mdi and macd < macd sig
 TimeFrameRestore();


 plot ribbon 1; // 15 min
 plot ribbon2; // hourly

this will help u to write the afl
rgds
subroto
 
Last edited:

sr114

Well-Known Member
#3
ribbon in tf - 15, 30 and 1 hr ( can be changed via parameter window) of pdi, mdi and macd

Code:
_SECTION_BEGIN("Trend ribbon - subroto 29032013 ");
 tf1=Param("Time Frame1 (min)",15,5,60,1);
 tf2=Param("Time Frame2 (min)",30,15,90,1);
 tf3=Param("Time Frame3 (hr)",1,1,4,1);

 tfrm1=in1Minute*tf1;
 tfrm2=in1Minute*tf2;
 tfrm3=inHourly*tf3;

 TimeFrameSet(tfrm1); //ribbon1 ,tf = lower
 uptrend1=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
 dntrend1=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
 TimeFrameRestore();

 TimeFrameSet(tfrm2); //ribbon , tf = 30 min
 uptrend2=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
 dntrend2=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
 TimeFrameRestore();

 TimeFrameSet(tfrm3); // ribbon 3, tf = 1 hr
 uptrend3=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
 dntrend3=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
 TimeFrameRestore();

 Plot( 2, "tf1", IIf( uptrend1, 5, 	IIf( dntrend1, 4, Null)), styleOwnScale|styleArea|styleNoLabel, -1, 100 );
 Plot( 4, "tf2", IIf( uptrend2, 34, 	IIf( dntrend2, 25, Null)), styleOwnScale|styleArea|styleNoLabel, -1, 100 );
 Plot( 6, "tf3", IIf( uptrend3, 51, 	IIf( dntrend3, 33, Null )),styleOwnScale|styleArea|styleNoLabel, -1, 100 );

 Plot(C,"",colorGreen,64);
rgds
subroto
 

Similar threads