Hello, The dynamic support-resistance formule could be useful to plot multi-timeframe ribbons...
http://codefortraders.com/phpBB3/viewtopic.php?f=60&t=107&sid=bb6a3e5165f0edf18ecbf93d91c5944d Best regards Evelyn Broom a écrit : > > I have written to support on 4 different occasions over the past 3 > months and have never received a reply, so I thought I would try this > forum. I hope someone can help me. It seems to be a simple matter > for someone who understands how to code in afl....so perhaps a lot of > people who have seen my posts at other forums are rolling on the floor > laughing themselves to tears, while I am in tears for the opposite > reason. :-( > > I am trying to create a multi-timeframe ribbon at the bottom of my > charts using range bars rather than "time or minute" bars. I have > made several attempts on my own. I used the "minute" timeframe, and > it still does not work and I "borrowed" this code from a few different > posts. (Believe it or not, I have even read the 300+ page manual!) > The explanation in the manual and tutorial are not clear to me on how > to code using range bars, and I have not found anything on any forum > regarding how to code with them. > > Can someone please tell me what I am doing wrong? And, how can I > convert this to RANGE BARS? (Specifically, 375, 125 and 50 range > bars.) The strategy I plan to use is much more detailed than this, > but I am using this one as an example of what I am trying to > accomplish because it is a much shorter example. > > I would really appreciate if someone knows how to do this and is > willing to share. > > Thank you, > > Evelyn..............following is the code..... > > #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(*in1Minute**30); > > MA5_30 = MA(*C*,5); > > MA8_30 = MA(*C*,8); > > MA14_30 = MA(*C*,14); > > Color= IIf(MA(*C*,5) > MA(*C*,8) *AND* MA(*C*,8) > (MA(*C*,14)), > *colorGreen*,6); > > Plot(20,"",Color,*styleHistogram*+*styleThick*|*styleArea*|*styleNoLabel*,0,100); > > Plot(21,"",*colorBlack*,*styleOwnScale*|*styleArea*|*styleNoLabel*,0,100); > > PlotText("Heinkein 4T tf:"+Interval(2), textoffset, 61.95,*colorYellow*); > > printf("\n = " +WriteVal(*Close*)); > > CondB= MA(*C*,5) > MA(*C*,8) *AND* MA(*C*,8) > MA(*C*,14); > > Conds = *Close* < MA(*C*,5); > > TimeFrameRestore(); > > > > TimeFrameSet(*in1Minute**5); > > MA5_30 = MA(*C*,5); > > MA8_30 = MA(*C*,8); > > MA14_30 = MA(*C*,14); > > Color= IIf(MA(*C*,5) > MA(*C*,8) *AND* MA(*C*,8) > (MA(*C*,14)), > *colorGreen*,6); > > Plot(20,"",Color,*styleHistogram*+*styleThick*|*styleArea*|*styleNoLabel*,0,100); > > Plot(21,"",*colorBlack*,*styleOwnScale*|*styleArea*|*styleNoLabel*,0,100); > > PlotText("Heinkein 4T tf:"+Interval(2), textoffset, 61.95,*colorYellow*); > > printf("\n = " +WriteVal(*Close*)); > > CondB1= MA(*C*,5) > MA(*C*,8) *AND* MA(*C*,8) > MA(*C*,14); > > Conds1 = *Close* < MA(*C*,5); > > TimeFrameRestore(); > > > > TimeFrameSet(*in1Minute*); > > MA5_30 = MA(*C*,5); > > MA8_30 = MA(*C*,8); > > MA14_30 = MA(*C*,14); > > Color= IIf(MA(*C*,5) > MA(*C*,8) *AND* MA(*C*,8) > (MA(*C*,14)), > *colorGreen*,6); > > Plot(20,"",Color,*styleHistogram*+*styleThick*|*styleArea*|*styleNoLabel*,0,100); > > Plot(21,"",*colorBlack*,*styleOwnScale*|*styleArea*|*styleNoLabel*,0,100); > > PlotText("Heinkein 4T tf:"+Interval(2), textoffset, 61.95,*colorYellow*); > > printf("\n = " +WriteVal(*Close*)); > > CondB2= MA(*C*,5) > MA(*C*,8) *AND* MA(*C*,8) > MA(*C*,14); > > Conds2 = *Close* < MA(*C*,5); > > TimeFrameRestore(); > > > > *Buy*= CondB *AND* CondB1 *AND* CondB2; > > ** > > *Sell*=CondS *AND* CondS1 *AND* CondS2; > > ** > > *Buy*=ExRem(*Buy*,*Sell*); > > ** > > *Sell*=ExRem(*Sell*,*Buy*); > > PlotShapes(*shapeSmallCircle***Buy*, *colorGreen*,0,62.70); > > PlotShapes(*shapeSmallCircle***Sell*, *colorRed*,0,62.70); > >
