![]() |
|
| Discuss AmiBroker formula Language at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hello, Here is another swing trade expoloaration AFL. You can change it to suit your ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#11
|
|||
|
|||
|
Hello,
Here is another swing trade expoloaration AFL. You can change it to suit your requirements // SWING Trader// fi = V * (C - Ref(C, -1)); BuySIG1 = IIf ( ( ( fi - MA( fi, 13 )) >= 0 ), 1, 0 ); BuySIG2 = IIf ( ( ( fi - MA( fi, 3 )) <= 0 ), 1, 0 ); SellSIG1 = IIf ( ( ( fi - MA( fi, 13 )) <= 0 ), 1, 0 ); SellSIG2 = IIf ( ( ( fi - MA( fi, 3 )) >= 0 ), 1, 0 ); Buy = Cross((EMA(Close,15)),(EMA(Close,50)))AND Cross( MACD( 12, 26 ), Signal( 12, 26, 9 ) )AND Cross(PDI (14), MDI(14)) AND BuySIG1 OR BuySIG2; Sell = Cross( Signal(12, 26, 9), MACD(12,26) )AND Cross( Signal(12, 26, 9), MACD(12,26) ) AND Cross(MDI (14), PDI(14))AND SellSIG1 OR SellSIG2; Filter = C <10 AND C >2 AND Volume > 100000 AND C> Ref(C,-1)AND (PDI (14)>MDI(14)); Buy = ExRem(Buy,Sell); Sell = ExRem(Sell,Buy); Result = WriteIf(Buy,"Buy","Sell"); AddTextColumn(Result,"Trade", formatChar,IIf(Buy,colorDarkGreen,colorRed ), IIf(Sell,colorPink,colorLime)); AddColumn( Close, "Close", 1.2, IIf( ROC(C, 1 ) >= 0, colorDarkGreen,colorRed ),50 ); AddColumn(Ref(Close,-1),"Y-Close",1.2, IIf( ROC(Ref(C,-1),1)>=0,colorDarkGreen, colorRed ),50 ); AddColumn( Volume, "Volume", 10.0, IIf( ROC(V, 1 ) >= 0,colorDarkGreen, colorRed ) ); AddColumn( ROC( Close, 1 ), "ROC(1)", 1.2, IIf( ROC(C, 1 ) >= 0,colorDarkGreen, colorRed)); AddColumn( fi, "FORCE IDX", 2.0, colorDarkBlue,37 ); Regards Saji |
| Sponsored Links |
|
#12
|
|||
|
|||
|
Hi Siva and Saji,
Thank you very much for your quick response. Both the codes are working well. Condition of W%R < -80 was based on the attached article.Actually it is for market timing and not for individual stock I thought if a stock which is trending upwards starts falling for more than 5 days in a row it can be a sell off. Regards Niranjanam. |
|
#13
|
|||
|
|||
|
hi Saji
When I tried to run your afl code I got error "Error 29. Variable 'fi' used without having been initialized.".Pls advice rpc |
|
#14
|
|||
|
|||
|
Hello,
I rechecked the AFL. it is working for me. Make sure you have copied and pasted the full AFL. If not add this line also to initialize fi. fi = V * (C - Ref(C, -1)); Remember this is an exploration only. Regards Saji |
|
#15
|
|||
|
|||
|
hi saji
Being new to AB I do not know if I have done it right .Here is what I did.I copied the whole "formula"( including the lined you have mentioned and which already exist in your formula) in a file called "swing2.afl" and put the file in \formula\custom directory this showed the formula under custom folder in AB and I just rt clicked and selected "Insert".Pls guide me if I have done smthg wrong.Also pls explain the difference between exploration and formula. TIA rpc |
|
#16
|
|||
|
|||
|
Hello,
Try this out. Open Ami. Go to Analysis ,formula editor. Paste the full formula in the editor space. You will see the AFL as unnamed with a number. Now clicK on the AFL button with a tick mark to ensure that the formula you have copied is free of errors. Now if there are no errors use save as button to save the formula as AFL , say swing trade AFL in any folder you choose. Now again go to Analysis, click on Automatic Analysis. It will open the page where you may select the saved AFL from the folder you have saved and press the explore button to start the exploration. Select all symbols and dates.Please go through the help file of AMI. All you have to do is press F1 button. Of course this is a crude method. when you are familiar with AMI you can use the other methods. Regards Saji |
|
#17
|
|||
|
|||
|
Hi Friends,
---------------------------------------------------------------------------- The updated version of this AFL is available at http://www.traderji.com/64268-post35.html ---------------------------------------------------------------------------- Please find the attached AFL for converting NSE Bhavcopy to filtered copy, that can be imported into Amibroker. The steps for using the AFL is given in the AFL itself. I've taken into account only EQ and BE sections. We can customize to our needs. Please let me know, if it needs any improvement. Thanks, Praveen. Last edited by bvpraveen; 10th November 2006 at 09:00 AM. Reason: Updated the links |
|
#18
|
|||
|
|||
|
hi Saji
Thanks for the explanation.I will try it and let you know the result rpc |
|
#19
|
|||
|
|||
|
Quote:
1) the NSE cash market bhav copy is savable as a csv file in the format: cm03NOV2006bhav.csv. you may use the same file naming format to the source file. this will avoid the trouble of renaming the file while saving to the AFL desired format. the corresponding destination file name could be: cm03NOV2006.csv, in a different directory to make identifiacation easy for the user. this will be more relevant when other segments also are added. you may also give the option to user to retain/delete the source file after convertion. 2) the AFL may on it's own generate the file name from the current date & present it as a default, so that life becomes easier for the user. 3) similar AFL's may be generated for FnO segment also after release of the final version after considering all user opinions/requests, if any. not withstanding above comments, it's firstly a NEW concept and deserves a pat. congratulations. all the best. murthymsr |
|
#20
|
|||
|
|||
|
Hello Praveen,
What you have done is excellent and very useful. You may also try and incorporate changes suggested by Mr. Murthy. Regards Saji |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads for: AmiBroker formula Language
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need help on formula | cmlee | MetaStock | 23 | 8th October 2007 07:55 PM |
| Metastock ,Metatrader & Amibroker indicator formula | saji oommen | MetaStock | 0 | 4th June 2006 06:35 PM |
| Metastock language help | Ropewalker | MetaStock | 4 | 1st November 2005 09:16 PM |
| TradeStation & MetaStock Formula Language | bikertrader | MetaStock | 4 | 10th December 2004 01: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.