Help getting script to work with NT7 - NinjaTrader Programming | futures io social day trading
futures io futures trading


Help getting script to work with NT7
Updated: Views / Replies:442 / 3
Created: by markus3500 Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Help getting script to work with NT7

  #1 (permalink)
Elite Member
Cleveland OH
 
Futures Experience: Intermediate
Platform: NINJATRADER 7
Favorite Futures: ES
 
Posts: 48 since Dec 2012
Thanks: 18 given, 5 received

Help getting script to work with NT7

I have a script I found online of an indicator I have been looking for. Unfortunately I have no background in coding and not exactly sure on how I can import this text into a working indicator for NT7. I would appreciate any guidance on importing this to work with NT7. I have the copy of the script as it was presented on the webpage:

Its a Trade Volume Index [TVI] indicator

 
Code
#region Namespaces
using System;
#endregion

namespace ScriptCode {
    /// <summary>
    /// Indicator scripts are used for calculating a series of numerical values.
    /// 
    /// This script can be used in several ways:
    /// (1) It can be used on a chart.
    /// (2) It can be used from another script.
    /// (3) It can be used as a script column in a watchlist.
    /// </summary>
    public partial class MyIndicator : IndicatorScriptBase // NEVER CHANGE THE CLASS NAME
    {
#region Variables
        // Use for the underlying symbol index on which to calculate the indicator script.
        private int _symbolIndex;
        // Use for the minimum tick size.
        private double _MTV;
#endregion

#region OnInitialize
        /// <summary>
        /// This function accepts the user parameters for the script and is called when a new indicator instance is created. 
        /// One of the parameters accepted by it must be that of a symbol or another script that is
        /// based on a symbol (drawing, indicator, pattern or signal). This symbol will be used as the underlying symbol for the indicator.
        /// 
        /// The parameter values can be specified from the user interface (UI) or from another script, depending on usage.
        /// </summary>
        /// --------------------------------------------------------------------------------------------------
        ///                                 INSTRUCTIONS - PLEASE READ CAREFULLY
        /// --------------------------------------------------------------------------------------------------
        /// YOU MUST SET A PARAM TAG FOR EACH PARAMETER ACCEPTED BY THIS FUNCTION.
        /// ALL PARAM TAGS SHOULD BE SET IN THE 'OnInitialize' REGION, RIGHT ABOVE THE 'OnInitialize' FUNCTION.
        /// THE ORDER OF THE TAGS MUST MATCH THE ORDER OF THE ACTUAL PARAMETERS.

        /// REQUIRED ATTRIBUTES:
        /// (1) name: The exact parameter name.
        /// (2) type: The type of data to collect from the user: 
        /// Set to "Integer" when the data type is 'int'
        /// Set to "IntegerArray" when the data type is 'int[]'
        /// Set to "DateTime" when the data type is 'long' (The 'long' data type can only be used for date/time representation)
        /// Set to "DateTimeArray" when the data type is 'long[]' (The 'long' data type can only be used for date/time representation)
        /// Set to "Boolean" when the data type is 'bool'
        /// Set to "BooleanArray" when the data type is 'bool[]'
        /// Set to "Double" when the data type is 'double'
        /// Set to "DoubleArray" when the data type is 'double[]'
        /// Set to "String" when the data type is 'string'
        /// Set to "StringArray" when the data type is 'string[]'
        /// Set to "Indicator" when the data type is 'Indicator'
        /// Set to "Pattern" when the data type is 'Pattern'
        /// Set to "Signal" when the data type is 'Signal'
        /// Set to "Drawing" when the data type is 'Drawing'
        /// Set to "Symbol" when the data type is 'int' representing a symbol index.

        /// OPTIONAL ATTRIBUTES:
        /// (3) default: The default parameter value is only valid when the type is Integer, Boolean, Double or String. 
        /// (4) min: The minimum parameter value is only valid when the type is Integer or Double.
        /// (5) max: The maximum parameter value is only valid when the type is Integer or Double.

        /// EXAMPLE: <param name="" type="" default="" min="" max="">Enter the parameter description here.</param> 
        /// --------------------------------------------------------------------------------------------------
        /// <param name="symbolIndex" type="Symbol">Use for the underlying symbol index on which to calculate the indicator script.</param>
        public void OnInitialize(
            int symbolIndex) {
            // Set the symbol index.
            _symbolIndex = symbolIndex;
            // Set the MTV value.
            _MTV = SymbolTick(symbolIndex);
        }
#endregion

#region OnValue
        /// <summary>
        /// This function is used for calculating the indicator value for the latest bar (see the Indicator functions).
        /// </summary>
        /// <returns>The indicator value for the latest bar.</returns>
        public override double OnValue() {
            // Check whether the two consecutive closing prices have moved more than one tick.
            if (BarClose(_symbolIndex, 0) - BarClose(_symbolIndex, 1) > _MTV)
                return this[1] + BarVolume(_symbolIndex, 0);
            else
                return this[1] - BarVolume(_symbolIndex, 0);
        }
#endregion

#region OnRegisterPens
        /// <summary>
        /// This function is used for registering the indicator pens (see the IndicatorRegisterPen function).
        /// </summary>
        public override void OnRegisterPens() {
            // Register a pen.
            IndicatorRegisterPen(0, "Pen", IQ_Color.MIDNIGHT_BLUE, IQ_DashStyle.SOLID, 1);
        }
#endregion

#region OnSelectPen
        /// <summary>
        /// This function is used for selecting a registered indicator pen with which to color the latest indicator value.
        /// Call the IndicatorRegisterPen function from the OnRegisterPens function in order to register an indicator pen.
        /// </summary>
        /// <returns>The indicator pen index to use for coloring the latest indicator value.</returns>
        public override byte OnSelectPen() {
            // Color the indicator value with the zero pen.
            return 0;
        }
#endregion
    }
}

If someone can help with this I would greatly appreciate it

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,216 since Jun 2009
Thanks: 628 given, 6,314 received
Forum Reputation: Legendary


here is TVI indicator, it works pretty much like OBV indicator.
some info Trade Volume Index - Technical Analysis from A to Z

Attached Files
Register to download File Type: cs TVI.cs (7.6 KB, 14 views)
Reply With Quote
The following 2 users say Thank You to cory for this post:
 
  #4 (permalink)
Elite Member
Cleveland OH
 
Futures Experience: Intermediate
Platform: NINJATRADER 7
Favorite Futures: ES
 
Posts: 48 since Dec 2012
Thanks: 18 given, 5 received


cory View Post
here is TVI indicator, it works pretty much like OBV indicator.
some info Trade Volume Index - Technical Analysis from A to Z

Thank you Cory... its greatly appreciated!!!

Reply With Quote

Reply



futures io > > > > > Help getting script to work with NT7

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
NT7: Same Script, Two different computers, two completely different backtest results! skytrader91 Elite Automated Trading 5 November 29th, 2014 10:30 PM
Convert Custom MACD Script To Work With Ninja Trader API conord NinjaTrader 3 February 20th, 2013 08:31 AM
Can someone try to make this indicator work in NT7? FBJS NinjaTrader Programming 10 January 28th, 2012 03:09 PM
Does anyone know if SBSRenko and RangeNoGap bars work in NT7 Todd NinjaTrader 3 May 14th, 2010 04:23 PM
Will the BMT Envelope Expansion indicator work on NT7? cbtrade NinjaTrader 4 March 23rd, 2010 08:52 PM


All times are GMT -4. The time now is 03:41 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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 2017-12-13 in 0.07 seconds with 20 queries on phoenix via your IP 54.226.132.197