Changes

Jump to navigation Jump to search

Beginner's Guide to MultiCharts Programming

670 bytes added, 16:07, 27 April 2017
no edit summary
== Layout ==
Some tips regarding the layout of a coding script.
 
=== General layout tips ===
Some general layout tips are:
 
* Use tabs and empty lines to make the code better readable - don't forget: if you want to edit your script a half-year from now, you'll still need to be able to comprehend it.
* Make use of comments.
* While it isn't needed in EasyLanguage to use parentheses ( & ) after an 'if' statement, it makes the code better readable and prevents errors.
* Make your code explicit. For example, instead of writing ''if LastBarOnChart then'' write ''if (LastBarOnChart = True) then''. While both statements work, the latter makes it easier to debug and makes the implicit assumptions you're making explicit.
=== Description ===
==== Other Input formatting suggestions ====
* Start[[IntraBarPersist]] variables with a captial letter (e.g. ''MyDefinedVariable'') and start regular variables with a normal letter (e.g. ''myDefinedVariable''). This helps to keep track of which variables are regular and which ones are IntraBarPersist.
== If else statements ==
When writing [[Comparisons_and_Loops:Category:Comparisons and Loops|if else If Else statements]] the use of '''tabs''' are is highly recommendrecommended.
Some examples of poor formatting would be:

Navigation menu