Coding Standards - DRAFT 2009 09 30 - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Coding Standards - DRAFT 2009 09 30
Started:September 30th, 2009 (10:39 AM) by Saroj Views / Replies:1,346 / 0
Last Reply:September 30th, 2009 (10:39 AM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Coding Standards - DRAFT 2009 09 30

Old September 30th, 2009, 10:39 AM   #1 (permalink)
Elite Member
Arcata, CA
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
Saroj's Avatar
Posts: 482 since Jun 2009
Thanks: 223 given, 379 received

Coding Standards - DRAFT 2009 09 30

Here is my first cut at suggested coding standards for (formerly BMT). I welcome comments and suggestions... following these simple guidelines will save us all a frustrating experience such as RJay posted today.

1. If you are modifying someone else’s indicator (or strategy), first rename it, by:
- right click and select “Save As”; enter a descriptive name and assign a version number. Include a mneumonic that identifies you "RJay" preferably before the version number.
- whether starting from an existing code file or from scratch, use appropriate names and version numbers:
- Version numbers:
- NT doesn’t like periods in the name so use underscores; like this: “_v1_0” at the end of the name. The first number, “1” in this case, designates a major version; the 2nd number, “0” in this case, designates minor changes (tweaks).
- Change the names: i. at minimum change “public class nnn_RJay_v1_0 : Indicator” - also good idea to change the name in “[Gui.Design.DisplayName(“nnn_RJay_v1_0”)]; this will avoid confusion in knowing which indicator version is on a chart as this is the name that is displayed in the Indicator list for a chart.
2. Description and logging changes
- In the summary area, enter a description of the code
- Indicate which external files it references “SMA(Close, Period)” for instance, so the user knows what else is required to successfully use the indicator.
- Mention what the source code was, “based on ADXVMA” for instance.
- Log changes as you make version releases: for example: “2009 09 16 – Saroj - added capability of sound alerts”
- Include the name since others might make changes if a collaborative effort; this way, if there is a subsequent problem that person can be consulted.
3. Include liberal comments to create a pseudo code type understanding of the logic (not really necessary for very simple code files, but very helpful none-the-less; especially if someone else might be making changes later.
4. Organize routines by using “#region … #endregion” tags to make the code easier to read (Optional but helpful for complex code)5. Be sure you get a clean compile before closing the file. If you can’t resolve an error, comment it out with an explanation. NT will not allow any other compiles if even ONE indicator has an error in it.

Last edited by Saroj; September 30th, 2009 at 01:18 PM.
Reply With Quote
The following 5 users say Thank You to Saroj for this post:

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Coding Standards - DRAFT 2009 09 30

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Webinar: Basic NinjaScript coding, May 25th @ 4:30PM Eastern, 22:30 Berlin/Paris sam028 The Elite Circle 33 August 11th, 2011 10:37 AM
EU Willing to Let Greece Default Under New Plan: Draft Quick Summary News and Current Events 0 July 21st, 2011 09:20 AM
EU Racing to Draft Second Greek Bailout Quick Summary News and Current Events 0 May 30th, 2011 07:50 PM
Banks Ease Lending Standards for First Time in Four Years Quick Summary News and Current Events 0 August 16th, 2010 03:20 PM
Coding Standards Saroj NinjaTrader Programming 0 July 9th, 2009 11:31 PM

All times are GMT -4. The time now is 01:06 AM.

Copyright © 2016 by All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-27 in 0.08 seconds with 19 queries on phoenix via your IP