Need this AFL..pls Help me..

#1
Dear friends,

Plz help me to get this AFL


AFL NAME :- TRENDING RIBBON (3 Time frames)

Top ribbon will show - (custom time trend) i.e..5 mins,15mins, etc
Second ribbon ll show - 30 mins Trend
Third ll show - 60 mins trend.

Regards
Coolbrain
 

rpc

Active Member
#2
_SECTION_BEGIN("Multiple Trend");
// Define label bar (x) position location
#pragma nocache
blankRightBars = 5; //insert actual blank right bars specified in Preferences
barsInView = Status("lastvisiblebarindex") - Status("firstvisiblebarindex") - blankRightBars;
Offset = Param("Offset Bar", 0.95, 0, 1, 0.01);
textOffset = BarCount - (Offset * barsInView);


TimeFrameSet( in5Minute) ;
HaClose =EMA((O+H+L+C)/4,3);
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
X=Haopen<Ref( Haopen,-1) OR AlmostEqual( Haopen,Ref(Haopen,-1));
Color = IIf( Haopen > Haclose, colorRed, IIf( X,7,14));

Plot( 21,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,0, 100 );
PlotText("5 min", textoffset, 81.00, colorWhite);
CondB=Haopen > Haclose;CONDS=Haopen < Haclose;
event1=condS;
PlotShapes( IIf(event1 ,shapeCircle,0) ,5, 0,81.0);
event2=CondB;
PlotShapes( IIf(event2 ,shapeCircle,0) , 4, 0,81.0);
TimeFrameRestore();
TimeFrameSet( 3*in5Minute) ;
HaClose =EMA((O+H+L+C)/4,3);
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
X=HaOpen<Ref( Haopen,-1) OR AlmostEqual( HaOpen,Ref(HaOpen,-1));

Color = IIf( Haopen > Haclose, colorRed, IIf( X,7,14));

Plot( 41,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,0, 100 );
PlotText("15 min", textoffset, 81.18, colorWhite);
CondB1=Haopen > Haclose;CONDS1=Haopen < Haclose;
event3=condS1;
PlotShapes( IIf(event3 ,shapeCircle,0) ,5, 0,81.20);
event4=CondB1;
PlotShapes( IIf(event4 ,shapeCircle,0) , 4, 0,81.2);


TimeFrameRestore();
TimeFrameSet( inHourly) ;
HaClose =EMA((O+H+L+C)/4,3);
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
X=Haopen<Ref( Haopen,-1) OR AlmostEqual( Haopen,Ref(Haopen,-1));
Color2 = IIf( Haopen > Haclose, colorRed, IIf( X,7,14));

Plot( 61,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,0, 100 );
PlotText("Hourly", textoffset, 81.40, colorWhite);
CondB2=Haopen > Haclose;CONDS2=Haopen < Haclose;
event4=condS2;
PlotShapes( IIf(event4 ,shapeCircle,0) ,5, 0,81.40);
event5=CondB2;
PlotShapes( IIf(event5 ,shapeCircle,0) , 4, 0,81.4);


TimeFrameRestore();
TimeFrameSet(20*inDaily) ;
HaClose =EMA((O+H+L+C)/4,3);
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
X=Haopen<Ref( Haopen,-1) OR AlmostEqual( Haopen,Ref(Haopen,-1));
Color4 = IIf( Haopen > Haclose, colorRed, IIf( X,7,14));

Plot( 81,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,0, 100 );



TimeFrameRestore();
Sell=CondB AND CondB1 AND CondB2 ;
Buy= CondS AND CondS1 AND CondS2 ;
//Cover= Cond1 AND Cond2 OR Cond2 AND Cond3 OR Cond1 AND Cond3 ;
//Sell= Cond4 AND Cond5 OR Cond5 AND Cond6 OR Cond4 AND Cond6;
Buy=ExRem (Buy,Sell);Sell=ExRem(Sell,Buy);

GraphXSpace = 10;

//......................................
_SECTION_END();

see if this helps.Change according to your requirement.I have got this from this forum
 
#4
hi rpc

can you please post afl code with price and two ribbons for 15min and 60 min below price on same chart!

In short I like to see price on top and two small ribbons ,top one for 60min, bottom one for 15 min.
thanks
regards
ford7k
 

Similar threads