![]() |
|
| Discuss Multiple timeframe ribbons on one chart at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; I have attached the .afl code for a trading system I located on another website. ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#1
|
|||
|
|||
|
I have attached the .afl code for a trading system I located on another website. How can I convert the "minute" timeframes to Range bars?
I have been working on trying to do this for months, but have not been successful. Ultimately, I would like to create "ribbons" at the bottom of the chart that show when each timeframe (range bar timeframe) are in agreement. It has been done in the attached .afl, but it is in minutes and I would like to convert it to range bars. If someone could help me with converting the code from minutes to range bars, then I think I can use that code to trigger alerts using other indicators....at least that is my goal. If someone could assist me, I would greatly appreciate it. Thank you, Ev |
| The Following 5 Users Say Thank You to brevco For This Useful Post: | ||
kenneth (17th November 2008), kgsirasangi (16th November 2008), niftyrider (16th November 2008), soumya_b (16th November 2008), uasish (16th November 2008) | ||
| Sponsored Links |
|
#2
|
|||
|
|||
|
brevco,
Although, I am not an afl expert, and thus may not be able to help you, I am curious to know what are range bars and how do they help in bettering the chart presentation? PLease give more details at least to understand your requirements. If you have any chart based on range bars, your enclosing the chart would be appreciated. Regards. |
|
#3
|
|||
|
|||
|
Hello,
When you set the "range", then you know in advance exactly how many points or "ticks" it needs to move before the next candle (or "range bar") forms. I went to google and typed in "range bars" and came up with the following explanation from the Stocks and Commodities website that I beleive will help. Range bars are a unique way of building price charts and are excellent in finding the underlying trend and movement of the current bar. Since each bar on the chart has the same range (high to low), it reduces the volatility and noise within the range of the bar. Range bars are generated continuously as a new tick is formed outside the minimum price range. They are closely related to point & figure or renko charts, which are also based on equal price range change. The range bar chart is a study of pure price movement, and time is not taken into consideration while plotting the price action. Range bar movement is not time-dependent but does depend on price movement when a preset range of a price bar is complete; hence, the time axis (x-axis) on a range bar chart is irrelevant. When range bars are constructed, chart dependency on the time scale (x-axis) has been removed as it produces its own price scale on the y-axis. This helps remove gaps and produce clear levels of support & resistance. Range bars also work with other trend indicators, all instruments, and all time frame trading. Range bar charts are great for observing active market activity and are helpful in identifying support & resistance lines, buy/sell signals, and trendlines. I currently use range bars to trade with the CCI. I hope this helps. Just this morning, I found something very similar to what I am looking for that someone posted on another website. It was written for the MT4 trading platform and someone converted it to AFL for Amibroker. When I put it on my range bar chart I received an error. The chart needs to be set in minutes. So, I would still need to figure out how to convert it to range bars. I've attached the file in a word document so it can be cut and pasted into your formula window of Amibroker. If anyone can figure out how to convert this to range bars, I would be very grateful. Thank you, Evelyn |
|
#4
|
|||
|
|||
|
Hello,
I tried to attach a screenshot of a range bar chart, and evidently, the file exceeds the limit allowed for this forum. ![]() I'm sure a screenshot could be found through searching Google. Evelyn |
|
#5
|
|||
|
|||
|
Hi Brevco
Chadrakant has written one for EOD too / 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( 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)); Color = IIf( Haopen > Haclose, colorRed, IIf( X,7,14)); Plot(20,"", Color,styleHistogram|styleOwnScale|styleNoLabel, 0, 100 ); Plot( 21,"",colorBlack,styleOwnScale|styleArea|styleNoLa bel,0, 100 ); PlotText("DAILY TREND", textoffset, 81.05, colorWhite); CondB=Haopen > Haclose;CONDS=Haopen < Haclose; event1=condS; PlotShapes( IIf(event1 ,shapeDigit1,0) ,5, 0,81.0); event2=CondB; PlotShapes( IIf(event2 ,shapeDigit1,0) , 4, 0,81.0); TimeFrameRestore(); TimeFrameSet( inWeekly) ; 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(40,"", Color, styleHistogram|styleOwnScale|styleNoLabel, 0, 100 ); Plot( 41,"",colorBlack,styleOwnScale|styleArea|styleNoLa bel,0, 100 ); PlotText(" WEEKLY TREND", textoffset, 81.20, colorWhite); CondB1=Haopen > Haclose;CONDS1=Haopen < Haclose; event3=condS1; PlotShapes( IIf(event3 ,shapeDigit2,0) ,5, 0,81.20); event4=CondB1; PlotShapes( IIf(event4 ,shapeDigit2,0) , 4, 0,81.2); TimeFrameRestore(); TimeFrameSet( 10*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)); Color2 = IIf( Haopen > Haclose, colorRed, IIf( X,7,14)); Plot(60,"", Color2, styleHistogram|styleOwnScale|styleNoLabel, 0, 100 ); Plot( 61,"",colorBlack,styleOwnScale|styleArea|styleNoLa bel,0, 100 ); PlotText("2 WEEK TREND", textoffset, 81.40, colorWhite); CondB2=Haopen > Haclose;CONDS2=Haopen < Haclose; event4=condS2; PlotShapes( IIf(event4 ,shapeDigit3,0) ,5, 0,81.40); event5=CondB2; PlotShapes( IIf(event5 ,shapeDigit3,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(80,"", Color4, styleHistogram|styleOwnScale|styleNoLabel, 0, 100 ); Plot( 81,"",colorBlack,styleOwnScale|styleArea|styleNoLa bel,0, 100 ); PlotText("MONTHLY TREND", textoffset, 81.55, colorWhite); CondB3=Haopen > Haclose;CONDS3=Haopen < Haclose; event6=condS3; PlotShapes( IIf(event6 ,shapeDigit4,0) ,5, 0,81.65); event7=CondB3; PlotShapes( IIf(event7 ,shapeDigit4,0) , 4, 0,81.65); TimeFrameRestore(); Sell=CondB AND CondB1 AND CondB2 OR Condb3; Buy= CondS AND CondS1 AND CondS2 OR Conds3; //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); PlotShapes(shapeCircle*Buy, colorGreen,0,81.85); PlotShapes(shapeCircle*Sell, colorRed,0,81.85); GraphXSpace = 15; //...................................... _SECTION_END(); Regards ken |
|
#6
|
|||
|
|||
|
brevco,
Thank you for your explanation. Following web page shows and explains range bar chart http://www.forextips.com/range_bars.htm Regards |
|
#7
|
|||
|
|||
|
Thank you, Kenneth.
Since I trade intraday, it would be great to have this for range bars. This is definitely heading in the right direction and it is probably the closest I've gotten to finding what I've been searching for. I can probably figure out how to convert this to minute bars so it can be traded intraday, but I am still searching for a way to convert it to range bars. This is beautiful though. I think this would be great to use for longer term such as trading options....hopefully I'll get back into that again soon. Thanks again for responding and sharing this with me. I'm getting closer! Evelyn
|
|
#8
|
|||
|
|||
|
Hi Evelyn
Screen short for Intraday trading. Rgards Ken |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Indemnity, Disclaimer & Disclosure
Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum
Rules Disclaimer & Disclosure and indemnify Traderji.com, its
associates and related parties of all claims howsoever resulting from
the usage of the forum.
• Disclaimer: Trading or investing in stocks & commodities
is a high risk activity. Any action you choose to take in the markets
is totally your own responsibility. Traderji.com will not be liable for
any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
• Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein.
The writers may or may not be trading in the securities mentioned.
• All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy of information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. If you find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.