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 mishphar Yes Kalyan u r correct but I am completely new for ...


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

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #181  
Old 26th December 2007, 02:58 PM
Member
 
Join Date: Nov 2006
Posts: 1,496
Thanks: 55
Thanked 69 Times in 38 Posts
kkseal will become famous soon enoughkkseal will become famous soon enough
Reputation: 133
Default Re: AmiBroker formula Language

Quote:
Originally Posted by mishphar View Post
Yes Kalyan u r correct but I am completely new for this programming it is not that I will grasp in one day everything I am trying at my best and reading now all the alf functions so it will take some time just u write the code once then i will try to practice next.
thnx for ur encouraging word.
Ok this once.

x = MA(AdvIssues(),10)/MA(DecIssues(),10);

BUY = x > 0.75 AND CROSS(RSI(8),30);
SELL = CROSS(0.5,x) OR CROSS(65,RSI(8));

FILTER = BUY OR SELL;

ADDCOLUMN(x, "Adv/Decl");
ADDCOLUMN(RSI(8), "RSI");

Since this is more relevant for trading Index you can expand the FILTER to the following

FILTER = (BUY OR SELL) AND StrFind(StrToUpper(NAME()), "NIFTY");

(However not sure about the last part - never used it before)

Regards,
Kalyan.

Last edited by kkseal; 26th December 2007 at 07:56 PM. Reason: change in last FILTER statement
Reply With Quote
Sponsored Links
  #182  
Old 27th December 2007, 01:07 AM
Member
 
Join Date: Dec 2006
Location: Puri
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
mishphar is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

thnx kalyan for the coding but the code doesn’t show any result neither any buy signal nor any sell but it's not a matter at list I know the procedure how to write the alf coding
thnx again
Reply With Quote
  #183  
Old 27th December 2007, 10:33 AM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 914
Thanks: 0
Thanked 33 Times in 3 Posts
bvpraveen will become famous soon enough
Reputation: 65
Default Re: AmiBroker formula Language

Quote:
Originally Posted by mishphar View Post
thnx kalyan for the coding but the code doesn’t show any result neither any buy signal nor any sell but it's not a matter at list I know the procedure how to write the alf coding
thnx again
Hi,

As Kalyan tells, just concentrate on knowing the main coding part in AFL. Colours, arrows, filter, etc are simple and can be added later.

You can look at this AFL skeleton code, which will help in the latter part mentioned above: http://www.traderji.com/82731-post93.html

Praveen.
Reply With Quote
  #184  
Old 27th December 2007, 02:00 PM
Member
 
Join Date: Nov 2006
Posts: 1,496
Thanks: 55
Thanked 69 Times in 38 Posts
kkseal will become famous soon enoughkkseal will become famous soon enough
Reputation: 133
Default Re: AmiBroker formula Language

Mishphar,

There might be some issue with setting up the composites etc. I'll check it out and get back to you soon.

Don't worry, it'll work.

Regards,
Kalyan.
Reply With Quote
  #185  
Old 27th December 2007, 08:53 PM
Member
 
Join Date: Nov 2006
Posts: 1,496
Thanks: 55
Thanked 69 Times in 38 Posts
kkseal will become famous soon enoughkkseal will become famous soon enough
Reputation: 133
Default Re: AmiBroker formula Language

Ok here we go. (The first 3 Steps invlve the necessary groundwork while the 4th step is the coding & execution)


STEP I : Seting IsIndex property for base Index

In symbols pane Select NIFTY (or whatever symbol name you have for the NIFTY index)
Goto Symbol->Information menu item and scroll down to Composites in the Information dialog box that appears. Set IsIndex property to 'yes'.

STEP II : Seting base Index for Composites

Open Categories window using Symbol -> Categories menu item.
Select NSE (or whatever mkt name you have) in Markets tab
In 'Base indexes for - Composites' combo enter NIFTY (or whatever symbol name you have for the NIFTY index)

STEP III : Calculating Adv/Decl composites

Choose "Symbol ->Calculate composites" menu item to open the Composites recalculation window
Check Number of advancing/declining issues. In 'Apply to' Select 'All quotes'and 'This market'->Select NSE (or whatever mkt name you have).
Click Calculate (this will take some time, you can however choose to use just the past 3/6/12 mths data. Enter the date range/no. of bars accordingly)

STEP IV: Coding & Executing

The Exploration code :

Quote:
x = MA(AdvIssues(),10)/MA(DecIssues(),10);

Buy = x > 0.75 AND Cross(RSI(8),30);
Sell = Cross(0.5,x) OR Cross(65,RSI(8));

Filter = (Buy OR Sell); //AND IsIndex();*

AddColumn(x, "Adv/Decl");
AddColumn(RSI(8), "RSI");
AddColumn( IIf( Buy, Asc("B"), Asc("S")), "Signal", formatChar );
Open Formula Editor using Analysis->Formula Editor menu, type the formula and choose Tools->Send to Automatic Analysis menu in Formula editor
To base your exploration on the most recent quote you should choose "n last quotations" and "n=1"
-------------
* If you include the IsIndex() flag and get no output for n=1, increase the value to 10,20,30. However this for testing only.

MISCELLANY :

You can include other tradable indices (like CNX IT, BANK NIFTY, CNX NIFTY Jr, CNX 100) in your Exploration by setting their IsIndex property to True as in Step I.
If you're using the ASCII Importer you can Calculate composites automatically while importing data by checking the 'calculate Composites' option in the Import dialog.
Check the EXREM function to remove excessive (consecutive buys or sells) signals.

Regards,
Kalyan.
Reply With Quote
  #186  
Old 28th December 2007, 01:29 AM
Member
 
Join Date: Dec 2006
Location: Puri
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
mishphar is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Yes Kalyan u r a genius I can’t believe that u hv so depth knowledge about Amibroker ok its fine but from to-day I will call u as my GURU may GOD blessed u
Thnx
mishphar
Reply With Quote
  #187  
Old 28th December 2007, 01:35 PM
Member
 
Join Date: May 2006
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
amitabha chatterjee is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Hi,

I'm new to AMIBROKER. Recently I've found the metastock code for ELDER AUTO ENVELOPE. Can anyone plz convert it to AFL. Thanks
Regards


MS FORMULA

EMA:=Input("Base EMA",1,100,22);
Factor:=Input("Factor",1,50,27);
avg:=Mov(C,EMA,E);
csize:= Stdev(2*Max(Abs(H-avg) ,Abs(L-avg)) / avg,100)*Factor/10;
{Use 100 days for stable channel size - default is 2.7 std}
Csize:= ValueWhen(1,
DayOfWeek()<Ref(DayOfWeek() ,-1) OR (
DayOfWeek()=Ref(DayOfWeek(),-1) AND DayOfMonth() <> Ref(DayOfMonth(),-1))
,Ref(csize,-1));
{ This pegs the Stdev to last bar of week and only changes once per week}
csize:=LastValue(csize);
{fix to constant using last value}
channel:=csize*avg;
avg+channel/2;
avg-channel/2;
avg;
Reply With Quote
  #188  
Old 28th December 2007, 02:26 PM
Member
 
Join Date: Nov 2006
Posts: 1,496
Thanks: 55
Thanked 69 Times in 38 Posts
kkseal will become famous soon enoughkkseal will become famous soon enough
Reputation: 133
Default Re: AmiBroker formula Language

Quote:
Originally Posted by mishphar View Post
Yes Kalyan u r a genius I can’t believe that u hv so depth knowledge about Amibroker ok its fine but from to-day I will call u as my GURU may GOD blessed u
Thnx
mishphar
Thanks. But please don't fall prey to the far-too-common malady of guru-ism.

There's only one guru - KNOWLEDGE & only one genius - IT'S APPLICATION. (The rest is nothing more than disabling mental crutches)

For more ideas on marketwide composite indicators see the Market Internals thread by Sunil Saranjame (he has done it all in Excel without the help of Ami - which makes him a greater guru )

To see how you can make composite indicators even out of stuff like the RSI, check the ADDTOCOMPOSITE function in Ami.

Regards,
Kalyan.
Reply With Quote
  #189  
Old 28th December 2007, 02:30 PM
Member
 
Join Date: Nov 2006
Posts: 1,496
Thanks: 55
Thanked 69 Times in 38 Posts
kkseal will become famous soon enoughkkseal will become famous soon enough
Reputation: 133
Default Re: AmiBroker formula Language

And to see how you can free your mind from the 'sentinels' that strive to limit it, see 'The Matrix'
Reply With Quote
  #190  
Old 2nd January 2008, 08:19 PM
Member
 
Join Date: Sep 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
SRJC is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

HI
I am having esignal data feed with Amibroker 5 trail version.
While stock charts are getting updated realtime, Futures/derivatives charts are not getting updated realtime.

Two Charts of nifty spot and nity futures enclosed

RMO Oscillator and 200 EMA are developed courtesy :=sSenior members of this Forum.

Any members have faced similar problems and what is the solution.

Thanks in advance

SRJC
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:32 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