![]() |
| Discuss trying to do AFL coding....Help please. at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hi everyone, been hee for a few days and the amount of information and wisdom ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#1
|
|||
|
|||
|
Hi everyone, been hee for a few days and the amount of information and wisdom on this forum is great...
Now I have been trying to program the following rules into Amibroker so that I can scan for stocks. 1. higher than 5 days volume 2. Aroon higher than 50 3. ADX higher than 30 4. RSI14 higher than 60 I am new to AFL so any help would be greately appreciated. Raj. |
|
#2
|
|||
|
|||
|
Quote:
/* Create date: 05 Jun 2007 The Volume of the current bar is greater than the Volume (Average) of 1 bar ago */ Filter = Volume > Ref( MA( Volume, 5 ), -1 ); AddColumn( Close, "Close " ); AddColumn( Open, "Open " ); AddColumn( High, "High " ); AddColumn( Low, "Low " ); AddColumn( Volume, "Volume " ); adx /* Create date: 05 Jun 2007 The ADX of the current bar is greater than 30 */ Filter = ADX( 14 ) > 30; AddColumn( Close, "Close " ); AddColumn( Open, "Open " ); AddColumn( High, "High " ); AddColumn( Low, "Low " ); AddColumn( Volume, "Volume " ); Rsi /* Create date: 05 Jun 2007 The RSI of the current bar is greater than 60 */ Filter = RSIa( Close, 14 ) > 60; AddColumn( Close, "Close " ); AddColumn( Open, "Open " ); AddColumn( High, "High " ); AddColumn( Low, "Low " ); AddColumn( Volume, "Volume " ); aroon i have no idea abt. thanks |
|
#3
|
|||
|
|||
|
Hi Swagat, thanx a lot for your time and effort. I got 2 syntax error:
Error31. Syntax error, expecting '(' Filter = ADX( 14 ) > 30; Filter = RSIa(Close, 14 ) > 60; I thought we could use something like this one: Filter = RSI(14) > 60 ADX(14) > 30 ; and at the end do something like this to only list stocks that qualify all the conditions: Filter = RSI(14) > 60 AND ADX(14) > 0 AND Volume > Ref( MA( Volume, 5 ), -1 ); AddColumn( Close, "Close " ); AddColumn( Open, "Open " ); AddColumn( High, "High " ); AddColumn( Low, "Low " ); AddColumn( Volume, "Volume " ); |
|
#4
|
|||
|
|||
|
ok I have got it this close, but getting an error at the last line. I think its the "Aroon_Osc" > 30; bit that is not right.
Also, if I wanna add Buy/Sell to it, what would be a good way to do it ? thanx a lot for your help, and hope somebody is able to fix it for me. This is really interesting. Code:
//**************************************************************************************** // My Exploration - Ver 4 // *************************************************************************************** /* Create date: 05 Jun 2007 The Volume of the current bar is greater than the Volume (Average) of 1 bar ago */ Filter = Volume > Ref( MA( Volume, 2 ), -1 ); //The ADX of the current bar is greater than 20 */ Filter = ADX( 14 ) > 20; //The RSI of the current bar is greater than 50 */ Filter = RSIa( Close, 14 ) > 50; // Exploration in Aroon Period = 14; LLVBarsSince = LLVBars(L, Period) + 1; HHVBarsSince = HHVBars(H, Period) + 1; Aroon_Down = 100 * (Period - LLVBarsSince) / (Period - 1); Aroon_Up = 100 * (Period - HHVBarsSince) / (Period - 1); Aroon_Osc = Aroon_Up - Aroon_Down; AddColumn(Aroon_Osc, "Aroon_Osc", format=1.2); AddColumn( Close, "Close " ); AddColumn( Open, "Open " ); AddColumn( High, "High " ); AddColumn( Low, "Low " ); AddColumn( Volume, "Volume " ); Filter = RSIa( Close, 14 ) > 60 AND ADX(14) > 30 AND Volume > Ref( MA( Volume, 5 ), -1 ); AND "Aroon_Osc" > 30; Last edited by ra303; 6th June 2007 at 09:13 AM. |
|
#5
|
|||
|
|||
|
someone ?? Help Please....
|
|
#6
|
|||
|
|||
|
Quote:
Filter = RSIa( Close, 14 ) > 60 AND ADX(14) > 30 AND Volume > Ref( MA( Volume, 5 ), -1 ) AND Aroon_Osc > 30; 2. Assign the Filter variable just once. Assigning more than once is not logical. The usage of Filter in your last statement is correct - ie using AND, OR, etc... Quote:
Buy = Filter; will suffice for Buy signals. Similarly code for Sell signal. Please look at some sample AFLs, or templates(which i'd posted some time back), for getting Buy and Sell signals on charts(with arrows, etc) Get back to us for any clarifications. Praveen. |
|
#7
|
|||
|
|||
|
I need help on making indicators for weekly prices.
eg If today is thursiday, and the closing EOD is 111, and last week friday the opening was 91. That is opening on (n-4)th day and closing on nth day I need these data for all days. And then use it for indicators. How to do it? |
|
#8
|
|||
|
|||
|
Quote:
Praveen. |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads for: trying to do AFL coding....Help please.
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Better coding in metastock | oxusmorouz | MetaStock | 0 | 7th February 2007 07:56 AM |
| WSA : Help in coding | younggenius | Technical Analysis | 0 | 27th April 2005 05:50 PM |
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.