Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Dionysus New Year Present – Ninja & Excel

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Excel Interop -

    Does anyone have the link for the latest interop.excel.dll that actually works with this code?
    I have used the recommended dll download but get this log message:


    Error on calling OnBarUpdate method for indicator "Big Mike Excel on bar 0: Old format or invalid library -

    Regards and thx
    Last edited by elliot5; 11-21-2014, 09:25 AM. Reason: Update

    Comment


      Bike Mike Excel log error

      Originally posted by efeuvejota01 View Post
      Bertrand:
      I am almost at the end of the process... but i have "Error on calling 'OnBarUpdate' method for indicator 'BigMikeExcel' on bar 0: Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))"

      Do you have any idea how to solve it??
      Thank you very much!!
      FVJ

      I also get this error.... Am willing to pay for remote session to fix the comms on this indicator. Regards
      Last edited by elliot5; 11-21-2014, 08:57 AM. Reason: Update

      Comment


        need help

        Dear Sir,

        i have done it the way u have explained.

        now i just have a question can i add or hook up ninja trader with Microsoft excel i would like to show you my excel sheet im looking to plot this excel sheet in the ninja trader charts or as live data may be with external data field is it possible Kindly advise

        (see my attached excel snap shots) can you help me out write the program or set it up for me by using team viewer so u can log in my system and do it

        regards,

        vipul

        Comment


          Hello,

          There is not a supported way to import Excel data for plotting on charts, and I have not personally heard of anyone setting something like this up yet. However, it could theoretically be possible if Excel has an API through which you obtain data using C#.

          Although we do not offer full development services in-house, we have a wide range of highly competent partners in the NinjaTrader Ecosystem who would be happy to take a look at your requirements and possibly create something that will accomplish this goal. If you would like, I'll be happy to get you in touch with a member of our business development team, who can assist in finding the right development contractor/consultant for you.
          Dave I.NinjaTrader Product Management

          Comment


            hi

            hi dave,

            can you tell me if any one can make a program or write codes for me and how much will it cost me

            regards,

            vipul

            Originally posted by NinjaTrader_Dave View Post
            Hello,

            There is not a supported way to import Excel data for plotting on charts, and I have not personally heard of anyone setting something like this up yet. However, it could theoretically be possible if Excel has an API through which you obtain data using C#.

            Although we do not offer full development services in-house, we have a wide range of highly competent partners in the NinjaTrader Ecosystem who would be happy to take a look at your requirements and possibly create something that will accomplish this goal. If you would like, I'll be happy to get you in touch with a member of our business development team, who can assist in finding the right development contractor/consultant for you.

            Comment


              hi need some help

              To Mr Bond,

              can you help me out i just have a question can this method add or hook up ninja trader with Microsoft excel i would like to show you my excel sheet im looking to plot this excel sheet in the ninja trader charts or as live data may be with external data field is it possible Kindly advise

              (see my attached excel snap shots) can you help me out write the program or set it up for me by using team viewer so u can log in my system and do it

              have you tried it does it work

              regards,

              vipul

              Originally posted by bondcrash View Post
              Hi there,

              does anyone know if the method suggested in this tread works for PULLING LIVE FEEDS IN EXCEL from Ninja? I need some FX live feeds and I am thinking to get them from Kinetick but I just want to be sure that I am not wasting time and money... Does anyone know if the resulting connection is stable (no stale feed etc)?

              Many thanks
              BC
              Attached Files

              Comment


                Thanks for this!

                I tried multiple symbols for example I added: Add("$EURUSD", PeriodType.Minute, 5); in Initialize().

                However when I try for example Closes[1][0].. it gets stuck at the first update, it doesn't update anymore..

                Do you know how to add multiple symbols?

                Thx!!

                Comment


                  Consultant Programming Services

                  Originally posted by NinjaTrader_Dave View Post
                  Hello,

                  There is not a supported way to import Excel data for plotting on charts, and I have not personally heard of anyone setting something like this up yet. However, it could theoretically be possible if Excel has an API through which you obtain data using C#.

                  Although we do not offer full development services in-house, we have a wide range of highly competent partners in the NinjaTrader Ecosystem who would be happy to take a look at your requirements and possibly create something that will accomplish this goal. If you would like, I'll be happy to get you in touch with a member of our business development team, who can assist in finding the right development contractor/consultant for you.
                  Hi

                  I have read through all of the posts here about how to link Ninja and Excel. I am not a programmer, but would be interested in paying for someone to set up this link for me. Basically, I want to be able to do statistical analysis using excel's capabilities but need the market data from various contracts to be able to do this.

                  So, for example, I would want daily data for the SP500 exported to a spreadsheet using the columns: Date, Open, High, Low, Close. Just need it to update on a daily basis.

                  Can anyone recommend a Ninja consultant/programmer to do this? Many thanks in advance.

                  Chris

                  Comment


                    Hello Chris,

                    This is Brant from NinjaTrader Ecosystem. I included the following link that has our NinjaScript Consultant Partners for you to review.

                    Search trading indicators, apps and services to personalize your NinjaTrader software. Explore custom trading indicators, automated strategies, free trading apps & more!


                    You can locate the contact information for the partner on their direct webpage for any additional questions you may have. Since these partners are third party consultants for NinjaTrader all pricing information will need to be obtained through the partner.

                    Please let us know if you have any more questions or concerns.
                    BrantNinjaTrader Customer Service

                    Comment


                      Thankyou

                      Thankyou for your message and the link Brant. I will check those sources.

                      Cheers
                      Chris

                      Comment


                        I get this error when I try to use this indicator. I am using Excel 2016 on Windows 10. Any suggestions? Here is the error I get in the Ninjatrader 7 Log:
                        Error on calculating indicator min/max value for indicator 'BigMikeExcel'. Please check the 'GetMinMaxValues' method: Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.

                        Comment


                          Thanks for the sharing,

                          can i ask you how can i add the volume like time and sales in the code of the indicator?

                          Thanks for the help
                          Attached Files
                          Last edited by mylanel86; 05-08-2017, 12:26 PM.

                          Comment


                            Hello,

                            I'm getting the following message when exporting to Excel...(Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER)). It appears that it's due to problems with multi thread processes talking to single threaded processes. Do you know of any solution to this? Thank you.

                            Comment


                              Hello Ciro are a professional trader? are you live in Palermo?

                              Comment


                                hi guys, i tried to do this for nt8. i got it to compile but it's not working properly. i think there is a problem with the dll. i'd export the file but it's not letting me export. code below:

                                basically, i had to download the excel.dll that's mentioned in this thread and drop it in the custom folder for nt8. it compiles but i'm getting these errors when i book up nt8.

                                Code:
                                Time	Category	Message
                                6/28/2018 11:28:03 PM	Default	Failed load vendor assembly 'C:\Users\Administrator\Documents\NinjaTrader 8\bin\Custom\Microsoft.Office.Interop.Excel.dll': The given key was not present in the dictionary.
                                Code:
                                Time	Category	Message
                                6/28/2018 11:28:03 PM	Default	Unable to retrieve type info for 'NinjaTrader.NinjaScript.AddOnBase' from assembly 'Microsoft.Office.Interop.Excel': Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
                                then when i add the indicator to a chart: i'm getting these errors:

                                Code:
                                Time	Category	Message
                                6/28/2018 11:57:02 PM	NinjaScript	Indicator 'test1': Error on calling 'SetState' method: Could not load file or assembly 'Office, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
                                does the Microsoft.Office.Interop.Excel.dll have a unique PublicKeyToken for each individual .dll? Because I downloaded mine from a random website online.

                                Also, later, I found that C:\Windows\assembly has Microsoft.Office.Interop.Excel but it's not a .dll file. In fact, it's not even a file. I don't know what it is.. i can't open it or anything... but the folder has a column called "public key token" and then each file has a secret token. Can it be that my token is different than the token i downloaded or is this something irrelevant and my code is just wrong??


                                Code:
                                //
                                // Copyright (C) 2018, NinjaTrader LLC <www.ninjatrader.com>.
                                // NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
                                //
                                #region Using declarations
                                using System;
                                using System.Collections.Generic;
                                using System.ComponentModel;
                                using System.ComponentModel.DataAnnotations;
                                using System.Linq;
                                using System.Text;
                                using System.Threading.Tasks;
                                using System.Windows;
                                using System.Windows.Input;
                                using System.Windows.Media;
                                using System.Xml.Serialization;
                                using NinjaTrader.Cbi;
                                using NinjaTrader.Gui;
                                using NinjaTrader.Gui.Chart;
                                using NinjaTrader.Gui.SuperDom;
                                using NinjaTrader.Data;
                                using NinjaTrader.NinjaScript;
                                using NinjaTrader.Core.FloatingPoint;
                                using NinjaTrader.NinjaScript.DrawingTools;
                                #endregion
                                
                                // This namespace holds indicators in this folder and is required. Do not change it.
                                namespace NinjaTrader.NinjaScript.Indicators
                                {
                                	/// <summary>
                                	/// The MACD (Moving Average Convergence/Divergence) is a trend following momentum indicator
                                	/// that shows the relationship between two moving averages of prices.
                                	/// </summary>
                                	public class MACD : Indicator
                                	{
                                		private	Series<double>		fastEma;
                                		private	Series<double>		slowEma;
                                		private double				constant1;
                                		private double				constant2;
                                		private double				constant3;
                                		private double				constant4;
                                		private double				constant5;
                                		private double				constant6;
                                
                                		protected override void OnStateChange()
                                		{
                                			if (State == State.SetDefaults)
                                			{
                                				Description					= NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionMACD;
                                				Name						= NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameMACD;
                                				Fast						= 12;
                                				IsSuspendedWhileInactive	= true;
                                				Slow						= 26;
                                				Smooth						= 9;
                                
                                				AddPlot(Brushes.DarkCyan,									NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameMACD);
                                				AddPlot(Brushes.Crimson,									NinjaTrader.Custom.Resource.NinjaScriptIndicatorAvg);
                                				AddPlot(new Stroke(Brushes.DodgerBlue, 2),	PlotStyle.Bar,	NinjaTrader.Custom.Resource.NinjaScriptIndicatorDiff);
                                				AddLine(Brushes.DarkGray,					0,				NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine);
                                			}
                                			else if (State == State.Configure)
                                			{
                                				constant1	= 2.0 / (1 + Fast);
                                				constant2	= (1 - (2.0 / (1 + Fast)));
                                				constant3	= 2.0 / (1 + Slow);
                                				constant4	= (1 - (2.0 / (1 + Slow)));
                                				constant5	= 2.0 / (1 + Smooth);
                                				constant6	= (1 - (2.0 / (1 + Smooth)));
                                			}
                                			else if (State == State.DataLoaded)
                                			{
                                				fastEma = new Series<double>(this);
                                				slowEma = new Series<double>(this);
                                			}
                                		}
                                
                                		protected override void OnBarUpdate()
                                		{
                                			double input0	= Input[0];
                                
                                			if (CurrentBar == 0)
                                			{
                                				fastEma[0]		= input0;
                                				slowEma[0]		= input0;
                                				Value[0]		= 0;
                                				Avg[0]			= 0;
                                				Diff[0]			= 0;
                                			}
                                			else
                                			{
                                				double fastEma0	= constant1 * input0 + constant2 * fastEma[1];
                                				double slowEma0	= constant3 * input0 + constant4 * slowEma[1];
                                				double macd		= fastEma0 - slowEma0;
                                				double macdAvg	= constant5 * macd + constant6 * Avg[1];
                                
                                				fastEma[0]		= fastEma0;
                                				slowEma[0]		= slowEma0;
                                				Value[0]		= macd;
                                				Avg[0]			= macdAvg;
                                				Diff[0]			= macd - macdAvg;
                                			}
                                		}
                                
                                		#region Properties
                                		[Browsable(false)]
                                		[XmlIgnore]
                                		public Series<double> Avg
                                		{
                                			get { return Values[1]; }
                                		}
                                
                                		[Browsable(false)]
                                		[XmlIgnore]
                                		public Series<double> Default
                                		{
                                			get { return Values[0]; }
                                		}
                                
                                		[Browsable(false)]
                                		[XmlIgnore]
                                		public Series<double> Diff
                                		{
                                			get { return Values[2]; }
                                		}
                                
                                		[Range(1, int.MaxValue), NinjaScriptProperty]
                                		[Display(ResourceType = typeof(Custom.Resource), Name = "Fast", GroupName = "NinjaScriptParameters", Order = 0)]
                                		public int Fast
                                		{ get; set; }
                                
                                		[Range(1, int.MaxValue), NinjaScriptProperty]
                                		[Display(ResourceType = typeof(Custom.Resource), Name = "Slow", GroupName = "NinjaScriptParameters", Order = 1)]
                                		public int Slow
                                		{ get; set; }
                                
                                		[Range(1, int.MaxValue), NinjaScriptProperty]
                                		[Display(ResourceType = typeof(Custom.Resource), Name = "Smooth", GroupName = "NinjaScriptParameters", Order = 2)]
                                		public int Smooth
                                		{ get; set; }
                                		#endregion
                                	}
                                }
                                
                                #region NinjaScript generated code. Neither change nor remove.
                                
                                namespace NinjaTrader.NinjaScript.Indicators
                                {
                                	public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
                                	{
                                		private MACD[] cacheMACD;
                                		public MACD MACD(int fast, int slow, int smooth)
                                		{
                                			return MACD(Input, fast, slow, smooth);
                                		}
                                
                                		public MACD MACD(ISeries<double> input, int fast, int slow, int smooth)
                                		{
                                			if (cacheMACD != null)
                                				for (int idx = 0; idx < cacheMACD.Length; idx++)
                                					if (cacheMACD[idx] != null && cacheMACD[idx].Fast == fast && cacheMACD[idx].Slow == slow && cacheMACD[idx].Smooth == smooth && cacheMACD[idx].EqualsInput(input))
                                						return cacheMACD[idx];
                                			return CacheIndicator<MACD>(new MACD(){ Fast = fast, Slow = slow, Smooth = smooth }, input, ref cacheMACD);
                                		}
                                	}
                                }
                                
                                namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
                                {
                                	public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
                                	{
                                		public Indicators.MACD MACD(int fast, int slow, int smooth)
                                		{
                                			return indicator.MACD(Input, fast, slow, smooth);
                                		}
                                
                                		public Indicators.MACD MACD(ISeries<double> input , int fast, int slow, int smooth)
                                		{
                                			return indicator.MACD(input, fast, slow, smooth);
                                		}
                                	}
                                }
                                
                                namespace NinjaTrader.NinjaScript.Strategies
                                {
                                	public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
                                	{
                                		public Indicators.MACD MACD(int fast, int slow, int smooth)
                                		{
                                			return indicator.MACD(Input, fast, slow, smooth);
                                		}
                                
                                		public Indicators.MACD MACD(ISeries<double> input , int fast, int slow, int smooth)
                                		{
                                			return indicator.MACD(input, fast, slow, smooth);
                                		}
                                	}
                                }
                                
                                #endregion

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by affilife, 02-17-2024, 09:53 AM
                                4 responses
                                116 views
                                0 likes
                                Last Post rjm1903
                                by rjm1903
                                 
                                Started by AdamDJ8, Today, 08:29 PM
                                0 responses
                                4 views
                                0 likes
                                Last Post AdamDJ8
                                by AdamDJ8
                                 
                                Started by AdamDJ8, 05-07-2024, 09:18 PM
                                3 responses
                                41 views
                                0 likes
                                Last Post AdamDJ8
                                by AdamDJ8
                                 
                                Started by Jorge Mendieta, Today, 07:35 PM
                                1 response
                                9 views
                                0 likes
                                Last Post Jorge Mendieta  
                                Started by rjm1903, Today, 04:14 PM
                                0 responses
                                11 views
                                0 likes
                                Last Post rjm1903
                                by rjm1903
                                 
                                Working...
                                X