![]() |
|
| Discuss ADX Scanner, Exploration and Back Test at the Technical Analysis within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hi Seniors, Can someone write an afl from the below mentioned conditions which can act ... |
|
|||||||
| Notices |
| Technical Analysis Discussion of all the principles involved in technical analysis. |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#1
|
|||
|
|||
|
Hi Seniors,
Can someone write an afl from the below mentioned conditions which can act as a scanner, explorer and backtester - BUY when – +DI crosses –DI from bottom to top +DI crosses ADX from bottom to top SELL when – -DI crosses +DI from bottom to top +DI crosses ADX from top to bottom -DI crosses ADX from bottom to top Thanks in advance. Cheers Abhi |
| Sponsored Links |
|
#2
|
|||
|
|||
|
Here's the AFL :
The backtest will not work properly as buy and sell are not balanced, you can use ExRem() to balance them (I have commented them, you can uncomment ). ////////////////////////////////////////////////////////////////////////////// // TEST ADX _SECTION_BEGIN("ADX TEST"); range = Param("Range",14,3,60,1); px = PDI(range); nx = MDI(range); ax = ADX(range); // Buy Conditions bcon1 = Cross(px,nx); bcon2 = Cross(px,ax); Buy = bcon1 OR bcon2; // Sell Conditions scon1 = Cross(nx,px); scon2 = Cross(ax,px); scon3 = Cross(nx,ax); Sell = scon1 OR scon2 OR scon3; // Explorer Filter = Buy OR Sell; AddColumn(Buy,"Buy",1); AddColumn(Sell,"Sell",1); // balancing buy sell ///Buy = ExRem(Buy, Sell); //Sell = ExRem(Sell, Buy); /// Plots Plot(px,"+DI",colorGreen,1); Plot(nx,"-DI",colorRed,1); Plot(ax,"ADX",colorBlue,5); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBl ue); PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colo rDarkRed); _SECTION_END(); |
|
#3
|
|||
|
|||
|
Thank you very much dear...its giving the desired results but when I click on scan it gives error 2 times and then show the results.
1st error - Plot(nx,"-DI",colorRed,1); Plot(ax,"ADX",colorBlue,5); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBl u ---------------------------------------------------^ Error 31. Syntax error, expecting ')' or ',' ================== 2nd error - Plot(ax,"ADX",colorBlue,5); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBl ue); PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colo r ---------------------------------------------------^ Error 31. Syntax error, expecting ')' or ',' Can you please remove these errors? Otherwise its working fine. Thx a million Abhinav |
|
#4
|
|||
|
|||
|
Oh.. It seems there are spaces... remove them "colorBl ue" and "colo r" remove the space...
and check all the lines... I dont know how it happened... ![]() also .. you can try to check the syntax... it will give you the exact error and you can fix it. enjoy |
|
#5
|
|||
|
|||
|
Yes it worked fine. YOu hit right on the target.
Thanks a ton again. Much appreciated... Thx Abhi |
|
#6
|
|||
|
|||
|
Hi Dhakkan,
In order to refine my scan results I have put in some additional conditions. Could you please modify the afl according to these - BUY when – +DI crosses –DI from bottom to top +DI crosses ADX from bottom to top but only if –DI is lower than +DI SELL when – -DI crosses +DI from bottom to top +DI crosses ADX from top to bottom but only if –DI is higher than +DI -DI crosses ADX from bottom to top but only if +DI is lower than -DI Thanks in advance Cheers Abhi |
|
#7
|
|||
|
|||
|
Quote:
These are simple things, learn AFL .. it will help you, or you may end up reveling all your tricks to others.. ![]() Anyway's... edited the AFL and here it is.... Check if it suits your requirement or not... ///////////////////////////////////////////////////////////////////////////////////// // TEST ADX _SECTION_BEGIN("ADX TEST"); range = Param("Range",14,3,60,1); px = PDI(range); nx = MDI(range); ax = ADX(range); // Buy Conditions bcon1 = Cross(px,nx); bcon2 = Cross(px,ax) AND nx < px; Buy = (bcon1) OR (bcon2); // Sell Conditions scon1 = Cross(nx,px); scon2 = Cross(ax,px) AND nx > px; scon3 = Cross(nx,ax) AND px < nx; Sell = (scon1) OR (scon2) OR (scon3); // Explorer Filter = Buy OR Sell; AddColumn(Buy,"Buy",1); AddColumn(Sell,"Sell",1); // balancing buy sell ///Buy = ExRem(Buy, Sell); //Sell = ExRem(Sell, Buy); /// Plots Plot(px,"+DI",colorGreen,1); Plot(nx,"-DI",colorRed,1); Plot(ax,"ADX",colorBlue,5); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBl ue); PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colo rDarkRed); _SECTION_END(); |
|
#8
|
|||
|
|||
|
Thank you very much dear..yes its working absolutely the way I wanted it to work. You are amazing..I am in the process of learning it but till the time I get expert like you I need help and guidance from you experts in writing my mind (tricks which come to my mind). I hope you dont mind helping me and of course anyone who is seeing this thread...
If we are able to develop a strategy which can be beneficial to all it wud be a great help to the trading community. Thanks a million for your unconditional and timely help. Much appreciated. Thanks Abhi |
| 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.