![]() |
|
| Discuss AmiBroker formula Language at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Originally Posted by bvpraveen Here is the required AFL: Code: _SECTION_BEGIN("BarChart"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#81
|
|||
|
|||
|
Quote:
|
|
#82
|
|||
|
|||
|
Dear praveen
Thanks for ur immediate reply, i'll try to learn something abt backtesting from user manual. Keep on active in this thread. Best wishes Raj |
|
#83
|
|||
|
|||
|
Quote:
I don't see any syntax error in the code. I double checked it. I'm using Amibroker 4.9. Let me know the exact error which you are getting, along with the line where it is throwing the error. Praveen. |
|
#84
|
|||
|
|||
|
Quote:
All the best, Praveen. |
|
#85
|
|||
|
|||
|
Quote:
![]() |
|
#86
|
|||
|
|||
|
Its nothing when compared with what I owe you
Praveen. |
|
#87
|
|||
|
|||
|
Dear Praveen and all,
Hi, i m back to disturb u all again. Basically i m looking for an AFL for crossover of EMA 5 and EMA 13. Buy when EMA 5 crosses from below EMA 13 and price also above the crossover Sell when opposite happens basically would like it for 30 or 60 minute, so that i can have stop loss as the low of previous bar for longs and vice versa for shorts. I know i m asking for too much, but i have got a lot in past too. with regards, Sunil |
|
#88
|
|||
|
|||
|
Quote:
Buy=Cross(EMA(Close,3),EMA(Close,13)); Sell=Cross(EMA(Close,13),EMA(Close,3)); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBl ue); PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colo rRed); Subrata Bera. |
|
#89
|
|||
|
|||
|
Quote:
To add to Subratabera's code, the below AFL is the generalized one. You can give any EMA periods to both short and long periods. You can use it for Explore also in Automatic Analysis. Code:
_SECTION_BEGIN("EmaCrossoverSystem");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
ShortPeriod = Param("ShortPeriod", 5, 2, 200, 1);
LongPeriod = Param("LongPeriod", 13, 2, 200, 1);
Buy=Cross(EMA(C,ShortPeriod),EMA(C,LongPeriod));
Sell=Cross(EMA(C,LongPeriod),EMA(C,ShortPeriod));
MYcolor = IIf( EMA(C,ShortPeriod) > EMA(C,LongPeriod) AND C>Peak(C,3,1), colorBrightGreen, IIf(EMA(C,LongPeriod) > EMA(C,ShortPeriod) AND C<Peak(C,3,1), colorRed, colorBlue));
PlotOHLC( Open, High, Low, Close, "", Mycolor, styleBar );
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );
Filter=Buy OR Sell;
SetOption("NoDefaultColumns", True );
AddColumn( DateTime(), "Date", formatDateTime );
AddTextColumn( FullName(), "Full name", 77 , colorDefault, IIf( Buy, colorGreen, colorRed ) );
AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar, colorDefault, bkcolor =IIf (Buy,colorGreen, colorRed ));
_SECTION_END();
|
|
#90
|
|||
|
|||
|
Great...
Thanks bvpraveen. There is a lot to learn from you. Keep posting. Subrata Bera. |
| 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.