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; Dear Praveen & Subratabera, Thanx for providing me with the afl. My apologies for replying ...


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

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #111  
Old 29th March 2007, 09:05 AM
Member
 
Join Date: Mar 2005
Posts: 23
Thanks: 3
Thanked 0 Times in 0 Posts
sunilhv0 is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Dear Praveen & Subratabera,

Thanx for providing me with the afl. My apologies for replying so late.

AFL works fine, but when i backtest it, it gives only for longs, whereas shorts should also be there. As per the system when a long is closed, then short is intiated at that very same time.

Is it possible to incorporate that too in AFL.

Thx for all the help and looking forward to an early reply.

Sunil

p.s. How do i add ur message while replying, at the moment i m just copying and pasting
Unread 22nd March 2007, 07:56 AM
bvpraveen bvpraveen is offline
Senior Member

Join Date: May 2006
Location: Bangalore
Posts: 605
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
Reply With Quote
  #112  
Old 29th March 2007, 10:23 AM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 913
Thanks: 0
Thanked 16 Times in 2 Posts
bvpraveen is on a distinguished road
Reputation: 48
Default Re: AmiBroker formula Language

Quote:
Originally Posted by sunilhv0 View Post
...
As per the system when a long is closed, then short is intiated at that very same time.

Is it possible to incorporate that too in AFL.
...
Just make this changes:
Buy = Cover = Cross(EMA(C,ShortPeriod),EMA(C,LongPeriod));
Sell= Short = Cross(EMA(C,LongPeriod),EMA(C,ShortPeriod));

Quote:
p.s. How do i add ur message while replying, at the moment i m just copying and pasting
Click the "Quote" button at the right bottom corner of the post.

Praveen.
Reply With Quote
  #113  
Old 29th March 2007, 11:03 AM
Member
 
Join Date: Mar 2005
Posts: 23
Thanks: 3
Thanked 0 Times in 0 Posts
sunilhv0 is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

[quote=bvpraveen;83672]Just make this changes:
Buy = Cover = Cross(EMA(C,ShortPeriod),EMA(C,LongPeriod));
Sell= Short = Cross(EMA(C,LongPeriod),EMA(C,ShortPeriod));


Click the "Quote" button at the right bottom corner of the post.

Dear Praveen,

Thx for such an early reply, it is working fine, wll fine tune it further with ur help.

Thx a lot

Sunil
Reply With Quote
  #114  
Old 29th March 2007, 12:26 PM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 913
Thanks: 0
Thanked 16 Times in 2 Posts
bvpraveen is on a distinguished road
Reputation: 48
Default Re: AmiBroker formula Language

Quote:
Dear Praveen,

Thx for such an early reply, it is working fine, wll fine tune it further with ur help.

Thx a lot

Sunil
Thats cool. All the best.

Praveen.
Reply With Quote
  #115  
Old 30th March 2007, 12:55 PM
Member
 
Join Date: Mar 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
mcsabee is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

hello!!

Can somebody help me?
How can I set that display function wich allows to see the candles:
-if Close price higher then the last close price and within day the close price is higher then open price green hollow candle(normally can set in)
-if Close price higher then the last close price BUT within day the close price is lowest than open price fully green candle!!
-if Close price lowest than last Close price fully red candle
- if Close price lowest than last Close price BUT within day Close price is higher than Open price posible to show red hollow candle?
I tried to setup on Preferences but this option is not allowed.If I colouring the candles I can’t see the hollow candles(bullish days).I think it need a new formula but couldn’t made it.
Thank you very much if you can help ...
Reply With Quote
  #116  
Old 30th March 2007, 02:59 PM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 913
Thanks: 0
Thanked 16 Times in 2 Posts
bvpraveen is on a distinguished road
Reputation: 48
Default Re: AmiBroker formula Language

Quote:
Originally Posted by mcsabee View Post
hello!!

Can somebody help me?
How can I set that display function wich allows to see the candles:
-if Close price higher then the last close price and within day the close price is higher then open price green hollow candle(normally can set in)
-if Close price higher then the last close price BUT within day the close price is lowest than open price fully green candle!!
-if Close price lowest than last Close price fully red candle
- if Close price lowest than last Close price BUT within day Close price is higher than Open price posible to show red hollow candle?
I tried to setup on Preferences but this option is not allowed.If I colouring the candles I can’t see the hollow candles(bullish days).I think it need a new formula but couldn’t made it.
Thank you very much if you can help ...
Hi,

Go through this discussion and see if it helps you out:
http://finance.groups.*****.com/grou...e&var=1&tidx=1

Praveen.
Reply With Quote
  #117  
Old 31st March 2007, 01:19 AM
Member
 
Join Date: Jul 2005
Posts: 444
Thanks: 36
Thanked 45 Times in 27 Posts
kenneth will become famous soon enough
Reputation: 75
Default Re: AmiBroker formula Language

Quote:
Originally Posted by bvpraveen View Post
Hi,

Go through this discussion and see if it helps you out:
http://finance.groups.*****.com/grou...e&var=1&tidx=1

Praveen.
In preferences - charting - Candlesticks area - select None-Up
Hollow Candle Gives hollow up candle with the shadow/outline in the selected
colour, from either preferences colour or in the plot statement

This works
Reply With Quote
  #118  
Old 2nd April 2007, 11:11 PM
Member
 
Join Date: Jan 2006
Posts: 219
Thanks: 0
Thanked 0 Times in 0 Posts
johnbest is on a distinguished road
Reputation: 25
Default Re: AmiBroker formula Language

dear friends,

I am using Futures Intra-day data provided by Soumya for study, especially NIFTY Fut. The Data is in Tick format which I can see in 1min, 5min, 15min, 1hr format easily. I want to create AFLs where the tick data will automatically get converted into 5min, 10 min, 15min, 30min and 1hr chart....

For this purpose I will have to use TimeFrameSet(). Can anybody help me
how to use this function for required time period mentioned?

have a nice day
JB
Reply With Quote
  #119  
Old 3rd April 2007, 10:01 AM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 913
Thanks: 0
Thanked 16 Times in 2 Posts
bvpraveen is on a distinguished road
Reputation: 48
Default Re: AmiBroker formula Language

Quote:
Originally Posted by johnbest View Post
dear friends,

For this purpose I will have to use TimeFrameSet(). Can anybody help me
how to use this function for required time period mentioned?

have a nice day
JB
Look in Amibroker User Guide.

Praveen.
Reply With Quote
  #120  
Old 3rd April 2007, 11:56 AM
Member
 
Join Date: Oct 2006
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
siddhakala is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Hello friends,

Is it possible to fomulate Modified Moving Average in AFL?
MAV is discussed in New Commodity Trading by Kaufman and Trading DiNapoli Levels by Joe DiNapoli

Formula of MAV is as follows:

MAVt=MAVt-1 + (P1 - MAVt-1)/n

where
MAVt is the current Modified Moving Average value
MAVt-1 is the previoud days Modified Moving Average value
P1 is current price
n is number of periods
The starting point is calculated identically to that of a simple Moving Average.

Thanks

Sudesh
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 11:05 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.
 


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

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