Reading values from Excel to Ninja - NinjaTrader Programming | futures io social day trading
futures io futures trading


Reading values from Excel to Ninja
Updated: Views / Replies:4,780 / 8
Created: by spinnybobo Attachments:0

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
 

Reading values from Excel to Ninja

  #1 (permalink)
Elite Member
Crete, IL/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker/Data: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Favorite Futures: ES, CL, EUR/USD, TF
 
spinnybobo's Avatar
 
Posts: 171 since Aug 2009
Thanks: 99 given, 48 received

Reading values from Excel to Ninja

Hello

I was wondering if anybody could help with some code to do the following:

I have some values I store in excel like VAH, POC, and VAL for market profile as well as others.
I would like to be able to create an indicator in NinjaTrader that when applied to a chart I can call all of the values from the excel spreadsheet and plot as horizontal lines.

The next step for this code would be to have an option to only call the last _____ number of values. I might want to plot only the last 6 values or the last 60 values. If I have a chart that is full of 1000 values, this would be the only reason to not call all of them--otherwise I would have to create multiple database of excel spreadsheets.

any ideas for coding would be much appreciated. I have some c++, and java experience and went through a few tutorials from Scott and Big Mike which were very helpful. This code would be most helpful as a lot of the work is putting lines on the chart.

thanks
Spencer

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
Bangkok
 
Futures Experience: Intermediate
Platform: MultiCharts.NET, S5, Ninj
Broker/Data: AMP, S5, IB
Favorite Futures: ES
 
DionysusToast's Avatar
 
Posts: 2,673 since Nov 2010
Thanks: 777 given, 8,742 received
Forum Reputation: Legendary


You can do it with Interop for Excel

https://futures.io/elite-circle/7307-dionysus-xmas-present-ninja-excel.html

Reply With Quote
The following 2 users say Thank You to DionysusToast for this post:
 
  #4 (permalink)
Elite Member
Calcutta, India
 
Futures Experience: Intermediate
Platform: ArthaChitra
 
Posts: 278 since Jun 2009
Thanks: 161 given, 259 received

i made a ninja to client (like excel) dde connector. the reverse is also possible. i did a basic framework for fellow member PrTester. you can contact him for an upgraded version, if he has any. the basic code which i did was is presented below.

 
Code
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;

using NDde.Client;
#endregion

// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    /// <summary>
    /// Enter the description of your new custom indicator here
    /// </summary>
    [Description("Enter the description of your new custom indicator here")]
    public class DDEClient : Indicator
    {
        #region Variables
        
        DdeClient client = null;
        
        #endregion

        /// <summary>
        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        /// </summary>
        protected override void Initialize()
        {
            
            Overlay                = true;
        }
        
        protected override void OnStartUp()
        {
            client = new DdeClient("Excel","Sheet1");
            if (!client.IsConnected)
            {
                client.Connect();
            }
            
            string command = "R1C1:R2C2";
            client.StartAdvise(command,1,true,60000);
            client.Advise += client_Advise;
            
        }

        
        private void client_Advise(object sender,DdeAdviseEventArgs e)
        {
            System.Windows.Forms.MessageBox.Show("Hi PrTester");
            
        }
        
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            
        }
        
        protected override void OnTermination()
        {
            if (client != null)
            {
                client.Advise -= client_Advise;
                if (client.IsConnected)
                {
                    client.Disconnect();
                }
                client.Dispose();
            }
        }

        #region Properties
       

       
        #endregion
    }
}
the code will connect excel and nt. write anything in cell A1 or A2, B2 a msg box will pop up.

you need the necessary dll, search the download section for NinjaDDE.

Reply With Quote
The following 3 users say Thank You to bukkan for this post:
 
  #5 (permalink)
Elite Member
Milan (I)
 
Futures Experience: Advanced
Platform: Ninjatrader
Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES
 
redratsal's Avatar
 
Posts: 1,653 since Oct 2010
Thanks: 1,217 given, 2,068 received


spinnybobo View Post
Hello

I was wondering if anybody could help with some code to do the following:

I have some values I store in excel like VAH, POC, and VAL for market profile as well as others.
I would like to be able to create an indicator in NinjaTrader that when applied to a chart I can call all of the values from the excel spreadsheet and plot as horizontal lines.

The next step for this code would be to have an option to only call the last _____ number of values. I might want to plot only the last 6 values or the last 60 values. If I have a chart that is full of 1000 values, this would be the only reason to not call all of them--otherwise I would have to create multiple database of excel spreadsheets.

any ideas for coding would be much appreciated. I have some c++, and java experience and went through a few tutorials from Scott and Big Mike which were very helpful. This code would be most helpful as a lot of the work is putting lines on the chart.

thanks
Spencer

Hi,

I did something similar https://futures.io/ninjatrader-programming/7677-help-please-moving-spreadsheet-v...dicator-2.html#post89852,

Reply With Quote
The following 2 users say Thank You to redratsal for this post:
 
  #6 (permalink)
Elite Member
Crete, IL/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker/Data: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Favorite Futures: ES, CL, EUR/USD, TF
 
spinnybobo's Avatar
 
Posts: 171 since Aug 2009
Thanks: 99 given, 48 received

thanks redratsal, bukkan, and DionysusToast for contributing. I will definitely take a look at those links and the code. I think this will help get me started:-)

Reply With Quote
 
  #7 (permalink)
Elite Member
Vizag+india
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Nifty
 
tinkug112's Avatar
 
Posts: 89 since May 2012
Thanks: 110 given, 87 received

Did you get this ?

Hi spinny,
Wondering if you got this figured out? Can you share it ?
I am looking at connecting feed from Excel to NT.

Reply With Quote
 
  #8 (permalink)
Elite Member
Crete, IL/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker/Data: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Favorite Futures: ES, CL, EUR/USD, TF
 
spinnybobo's Avatar
 
Posts: 171 since Aug 2009
Thanks: 99 given, 48 received


tinkug112 View Post
Hi spinny,
Wondering if you got this figured out? Can you share it ?
I am looking at connecting feed from Excel to NT.

I never got things working, but it looks like this method by dionysus a good way

https://futures.io/elite-circle/7307-dionysus-xmas-present-ninjatrader-excel.html

Reply With Quote
The following user says Thank You to spinnybobo for this post:
 
  #9 (permalink)
Elite Member
Los Angeles, CA
 
Futures Experience: Beginner
Platform: Multicharts
Broker/Data: Optimus Futures
Favorite Futures: CL
 
Posts: 7 since Mar 2014
Thanks: 31 given, 6 received

There's a pay-for product out there called XLSgate. They offer a free-trial version and then a lite version if you don't want to purchase that has much of the same write functionality but without the read functionality. I needed to get data back and forth to Excel throughout the trading day and XLSgate worked. Just an FYI - I don't work for these guys or have any stake in their activities.

I tried this solution but am not a good programmer - still working on it - so the pay-for solution helped me out.
https://futures.io/elite-circle/7307-dionysus-xmas-present-ninjatrader-excel.html

Reply With Quote
The following user says Thank You to supergordon for this post:

Reply



futures io > > > > > Reading values from Excel to Ninja

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dionysus Xmas Present – Ninja & Excel DionysusToast The Elite Circle 92 March 6th, 2017 01:17 AM
Utility To Transpose Optimized Strategy Values From Excel Output to Actual Strategy mercuryfx NinjaTrader 5 April 7th, 2012 04:59 PM
What is tape reading? Big Mike Traders Hideout 34 May 20th, 2011 08:58 AM
How to set values that Ninja Trader does not support. CryptOrchid NinjaTrader Programming 7 May 14th, 2010 10:51 AM
Translating EMA-values to ZN-values or visaversa max-td NinjaTrader Programming 17 June 22nd, 2009 04:42 PM


All times are GMT -4. The time now is 05:01 PM.

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-16 in 0.13 seconds with 19 queries on phoenix via your IP 54.163.210.170