Traderji.com - Discussion forum for Stocks Commodities & Forex

AmiBroker formula Language

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}} ...


Go Back   Traderji.com - Discussion forum for Stocks Commodities & Forex > TOOLS & RESOURCES > Software > AmiBroker

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #81  
Old 10th March 2007, 12:10 AM
Member
 
Join Date: May 2006
Location: Kolkata
Posts: 1,102
Thanks: 0
Thanked 0 Times in 0 Posts
Appreciation: 24
swagat86 is on a distinguished road
Default Re: AmiBroker formula Language

Quote:
Originally Posted by bvpraveen View Post
Here is the required AFL:

Code:
_SECTION_BEGIN("BarChart");
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 )) ));
UpColor = ParamColor("UpColor", colorBrightGreen);
DownColor = ParamColor("DownColor", colorRed);
MyColour = IIf(C >= O, UpColor, DownColor);
PlotOHLC(O,H,L,C,"Price", MyColour, styleBar);
Plot( Volume, _DEFAULT_NAME(), IIf(C>O, ParamColor("UpVolume", colorBlue), ParamColor("DownVolume", colorViolet)), ParamStyle( "Style", styleHistogram | styleOwnScale | styleThick, maskHistogram  ), 2 );
_SECTION_END();
Praveen.
Thanks a lot for workin this out BVP. But im gettin an error. General syntax error. Can u pls recheck.
Reply With Quote
  #82  
Old 10th March 2007, 07:22 AM
Member
 
Join Date: Sep 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Appreciation: 20
indrag91 is on a distinguished road
Default Re: AmiBroker formula Language

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
Reply With Quote
  #83  
Old 10th March 2007, 03:25 PM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 914
Thanks: 0
Thanked 5 Times in 1 Post
Appreciation: 37
bvpraveen is on a distinguished road
Default Re: AmiBroker formula Language

Quote:
Originally Posted by swagat86 View Post
Thanks a lot for workin this out BVP. But im gettin an error. General syntax error. Can u pls recheck.
Hi Swagat,

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.
Reply With Quote
  #84  
Old 10th March 2007, 03:27 PM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 914
Thanks: 0
Thanked 5 Times in 1 Post
Appreciation: 37
bvpraveen is on a distinguished road
Default Re: AmiBroker formula Language

Quote:
Originally Posted by indrag91 View Post
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
Backtesting and Automatic Analysis are very powerful in Amibroker. Fortunately backtesting is simple and if you face any problems, post here. Amibroker users can try to help you out.

All the best,
Praveen.
Reply With Quote
  #85  
Old 10th March 2007, 07:29 PM
Member
 
Join Date: May 2006
Location: Kolkata
Posts: 1,102
Thanks: 0
Thanked 0 Times in 0 Posts
Appreciation: 24
swagat86 is on a distinguished road
Default Re: AmiBroker formula Language

Quote:
Originally Posted by bvpraveen View Post
Hi Swagat,

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.
Its working man, thanks alot. I owe u one
Reply With Quote
  #86  
Old 10th March 2007, 08:21 PM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 914
Thanks: 0
Thanked 5 Times in 1 Post
Appreciation: 37
bvpraveen is on a distinguished road
Default Re: AmiBroker formula Language

Quote:
Originally Posted by swagat86 View Post
Its working man, thanks alot. I owe u one
Its nothing when compared with what I owe you

Praveen.
Reply With Quote
  #87  
Old 21st March 2007, 09:18 PM
Member
 
Join Date: Mar 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Appreciation: 20
sunilhv0 is on a distinguished road
Default Re: AmiBroker formula Language

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
Reply With Quote
  #88  
Old 21st March 2007, 10:47 PM
Member
 
Join Date: Jun 2005
Posts: 163
Thanks: 0
Thanked 0 Times in 0 Posts
Appreciation: 25
subratabera is on a distinguished road
Default Re: AmiBroker formula Language

Quote:
Originally Posted by sunilhv0 View Post
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
Try this...

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.
Reply With Quote
  #89  
Old 22nd March 2007, 07:56 AM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 914
Thanks: 0
Thanked 5 Times in 1 Post
Appreciation: 37
bvpraveen is on a distinguished road
Default Re: AmiBroker formula Language

Quote:
Originally Posted by sunilhv0 View Post
...
Basically i m looking for an AFL for crossover of EMA 5 and EMA 13.
...
Hi,

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();
Praveen.
Reply With Quote
  #90  
Old 22nd March 2007, 10:34 AM
Member
 
Join Date: Jun 2005
Posts: 163
Thanks: 0
Thanked 0 Times in 0 Posts
Appreciation: 25
subratabera is on a distinguished road
Default Re: AmiBroker formula Language

Great...

Thanks bvpraveen. There is a lot to learn from you.

Keep posting.

Subrata Bera.
Reply With Quote
Sponsored Links


Reply

Bookmarks


Advertise Here


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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


All times are GMT +5.5. The time now is 06:15 AM.

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.
 


Copyright © 2001 - 2008, Traderji.com All Rights Reserved.

Recommended Websites - www.TradersEdgeIndia.com - www.TradingPicks.com - www.MasterOfTrading.com