Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Connection to ATI on WIN 7
Collapse
X
-
Originally posted by NinjaTrader_RyanM View PostHello qpile,
You can post images to this forum directly. When creating a post, click the paper clip icon to add attachments.
In order to use ATI, you must check the AT Interface option under the File menu.
Comment
-
I ve got the same error
May be problem in my code?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace Program
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string inst = "ES 03-11";
string input1;
string input2;
double last = 0;
int connStatus;
bool getData = false;
int myCounter = 0;
NinjaTrader.Client.Client NTClient = new NinjaTrader.Client.Client();
//Console.WriteLine("Connect to Ninja Trader? y/n");
input1 = "y";
switch (input1)
{
case "y":
getData = true;
NTClient.SubscribeMarketData(inst);
break;
case "n":
getData = false;
richTextBox1.AppendText("Ok. Bye. Press <ENTER> to terminate program...\n");
// Console.WriteLine("Ok. Bye. Press <ENTER> to terminate program...", input1);
input2 = Console.ReadLine();
break;
default:
getData = false;
richTextBox1.AppendText("ERROR: Your input {0} is incorrect. Press <ENTER> to terminate program...\n");
// Console.WriteLine("ERROR: Your input {0} is incorrect. Press <ENTER> to terminate program...", input1);
input2 = Console.ReadLine();
break;
}
connStatus = NTClient.Connected(0);
if (connStatus == 0 && getData == true) richTextBox1.AppendText("Connected to NinjaTrader\n");
else if (connStatus != 0 && getData == true)
{
getData = false;
richTextBox1.AppendText("ERROR: Can not connect. Press <ENTER> to terminate program...\n");
input2 = Console.ReadLine();
}
if (getData)
{
last = NTClient.MarketData(inst, 0);
richTextBox1.AppendText(inst + " Last Price: " + last + "\n");
richTextBox1.AppendText("Logging off in 10 secs");
while (myCounter <= 10)
{
Thread.Sleep(500);
richTextBox1.AppendText(".");
myCounter++;
}
NTClient.UnsubscribeMarketData(inst);
NTClient.TearDown();
}
if (!getData)
{
NTClient.UnsubscribeMarketData(inst);
NTClient.TearDown();
}
}
}
}
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by RubenCazorla, 08-30-2022, 06:36 AM
|
3 responses
77 views
0 likes
|
Last Post
by PaulMohn
Today, 04:44 AM
|
||
Started by f.saeidi, Yesterday, 12:14 PM
|
9 responses
23 views
0 likes
|
Last Post
by f.saeidi
Today, 04:39 AM
|
||
Started by Tim-c, Today, 03:54 AM
|
0 responses
3 views
0 likes
|
Last Post
by Tim-c
Today, 03:54 AM
|
||
Started by FrancisMorro, Today, 03:24 AM
|
0 responses
5 views
0 likes
|
Last Post
by FrancisMorro
Today, 03:24 AM
|
||
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
10 responses
1,772 views
0 likes
|
Last Post
by Leafcutter
Today, 03:01 AM
|
Comment