Traderji.com - Discussion forum for Stocks Commodities & Forex

Better coding in metastock

Discuss Better coding in metastock at the MetaStock within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Most people who start off with metastock language tend to clutter their indicators and experts ...


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

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #1  
Old 7th February 2007, 07:56 AM
Member
 
Join Date: Sep 2006
Location: Chennai
Posts: 897
Appreciation: 57
oxusmorouz will become famous soon enough
Default Better coding in metastock

Most people who start off with metastock language tend to clutter their indicators and experts which make them really difficult to alter.
A good example would be a ,say, MACD crossover (I use MACD as an example here because most would be familier with it).

This is how beginners code their system: (you will know how hectic it is to understand)
Indicator:
(Mov(C,12,E)-Mov(C,26,E));
Mov(Mov(C,12,E)-Mov(C,26,E),9,E);
0

Expert:
Buy symbol:
Cross((Mov(C,12,E)-Mov(C,26,E)),Mov(Mov(C,12,E)-Mov(C,26,E),9,E));

Sell symbol:
Cross(Mov(Mov(C,12,E)-Mov(C,26,E),9,E),Mov(C,12,E)-Mov(C,26,E));

At this point, it would take a great deal of effort to:
---> Understand what was coded
---> Make others understand what was coded
---> Make changes in the MACD days
---> Add an additional condition in the formula

I'm a beginner in metastock myself but I have found some coding techniques which were of great help to me when I coded my formulas.

Indicator:
{ Time Periods }
FastPds:= Input("Fast MA",1,200,12);
SlowPds:= Input("Slow MA",1,200,26);
Signal:= Input("Signal",1,200,9);

{ Inputs }
a:= Mov(C,FastPds,E);
b:= Mov(C,SlowPds,E);
d:= a-b;

{ Condition }
d;
Mov(d,Signal,E);
0

x----------x

Expert --> Symbols

Buy:
a:= Mov(C,12,E);
b:= Mov(C,26,E);
d:= a-b
f:= Mov(d,9,E);

Cross(d,f);


Sell:
a:= Mov(C,12,E);
b:= Mov(C,26,E);
d:= a-b;
f:= Mov(d,9,E);

Cross(f,d);

x-----------x

Though the 2nd one may seem difficult to understand in the beginning, you would notice the relative ease of writing a formula once you get a hang of it. The chances of making formula errors are relatively less. Also it provides ease in changing the time periods and adding another, even, 100 conditions (if metastock permits).
Good luck.

Oxymoron.

(Special thanks to Mr.Jose Silva www.metastocktools.com from whose formulas I have learnt a lot of coding techniques)
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: Better coding in metastock
Thread Thread Starter Forum Replies Last Post
Almost everything about the MetaStock...... milind857 MetaStock 0 2nd September 2006 11:38 PM
Metastock maliavi MetaStock 3 27th April 2006 06:55 AM
metastock butta_trader MetaStock 1 16th June 2005 06:03 PM


All times are GMT +5.5. The time now is 01:52 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