API Support Forum
User Profile

Viewing User Profile for: JGronemus87


About

Nov 28, 2007 09:01 PM

Nov 30, 2010 11:37 AM

Feb 02, 2011 04:56 PM



Post Statistics
JGronemus87 has contributed to 14 posts out of 4461 total posts (0.31%) in 4341 days (0.00 posts per day).

20 most recent posts:

API Support » Unable to get Price Feed from Sim environment using API.DLL Nov 30, 2010 @ 11:37 AM (Total replies: 1)

Hello,

I have a custom C# program that tries to Subscribe to a price feed for the ESZ0 contract. No price feeds come. I tried this on Win7 64 bit and Win XP sp2 32 bit.

I have .net Frameworks 2.0, 2.0 SP2, 3.0, 3.5 SP1 installed.

On the Win7 execution, it looks like there is an exception that is thrown and caught in the OEC library. Here it is...

Exception: "Key not valid for use in specified state." (System.Security.Cryptography.CryptographicException)

Thread: Reader Price [7076]

Look highly suspicious. The exception is thrown before "OnLoginComplete" is called.

Below is all the source code with the password removed. I'm able to connect, but calling Subscribe does not produce any price updates.

What am I doning wrong? This is holding up all of our projects.

Thanks,
JGronemus87


The code....

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using OEC.API;


namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
OECClient mOEC = new OECClient();

bool IsUp = false;
double LastPrice = 0.0;

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
this.toolStripStatusLabel1.Text = "Disconnected";

mOEC.OnPriceChanged += new OnPriceChangedEvent(this.OEC_OnPriceChanged);
mOEC.OnPriceTick += new OnPriceChangedEvent(this.OEC_OnPriceTick);

mOEC.OnOrderFilled += new OnOrderFilledEvent(this.OEC_OnOrderFilled);
mOEC.OnLoginComplete += new OnLoginCompleteEvent(this.OEC_OnLoginComplete);
mOEC.OnContractsChanged += new OnContractsChangedEvent(this.OEC_OnContractsChanged);
}


// connect and start the timer.
private void button1_Click(object sender, EventArgs e)
{
// Making this call will connect successfully but throw the exception listed above.
mOEC.Connect("sim.openecry.com", 9200, "JGronemus12", "Demo99273", false);
}

private void OEC_OnLoginComplete()
{
// This gets called, but the exception is already thown?
try
{
this.toolStripStatusLabel1.Text = "Connected";
mOEC.RequestContracts(mOEC.BaseContracts["ES"]);
}
catch (Exception Ex)
{

}
}


private void OEC_OnContractsChanged(OEC.API.BaseContract bc)
{
// This gets called but the exception is already thrown.
mOEC.Subscribe(mOEC.Contracts["ESZ0"]);
}


private void OEC_OnPriceChanged(Contract contract, Price price)
{
ProcessUpdate(contract, price);
}

private void OEC_OnPriceTick(Contract contract, Price price)
{
ProcessUpdate(contract, price);
}

void ProcessUpdate(Contract c, Price p)
{
// This never gets called. Why?
}



private void OEC_OnOrderFilled(Order ord, Fill fill)
{

}

}
}

John

API Support » .NET Remoting issue Nov 04, 2010 @ 03:26 PM (Total replies: 3)

I have more details...

Here is the code in the custom program that creates the OECClient instance.

OEC = OECClient.CreateInstance(true);

if (OEC.RemoteHostingEnabled)
{
MessageBox.Show("Connected to remote instance");
}
else
{
MessageBox.Show("Created Local Instance.");
}


With this a messagebox will be displayed everytime the program starts. In every case were the program starts and the message reads "Created Local Instance", it does not work. In every case were the message reads "Connected to remote instance", it works. This is as I would have expected.

We doubled checked the OEC Trader Platform to verify that "Allow Remoting" is checked and it is. We also were very careful to start the OEC Trader platform first, then start the OnLinkSample Program that is trying to remote in and it still does not work. It created a local instance with I would have expected it to connect to a remote instance.

Any other tips that you can provide? Is there something in the code that I'm missing? I am able to get it to work with 3.5.0.16 on my Win 7 64 machine. Our client is not able to get it to work on is XP Pro SP3 machine.

The program is compiled against 3.5.0.0 version of the API.DLL file.

Thanks,
John


Thanks,
John

John

API Support » .NET Remoting issue Nov 02, 2010 @ 09:28 PM (Total replies: 3)

I will try that and report back to you.

John

API Support » .NET Remoting issue Oct 27, 2010 @ 03:42 PM (Total replies: 3)

Hello,

I have a Windows XP Pro machine that is having connection issues. The "Allow Remoting" Option is checked. I am trying to remote connect using a proprietary C# program. The version of OECTrader is 3.5.0.16.

On an identical machine using the same C# program, I am able to remote connect using OEC Trader 3.5.0.14.

Do you know of any issues with .NET Remoting in 3.5.0.16?

Thanks,
John

John

API Support » Can Partially Fill Orders be modified? Oct 21, 2010 @ 12:21 PM (Total replies: 1)

Hello,

Can paritially filled orders be modified? Example...I have an order to buy 10 contracts and I get a partial fill of 4, the order should still be working to buy 6 more contracts. At that point, can I modify the order? specifically, I would like to modify the price and quantity to something else. Is that allowed?

-John

John

API Support » Unable to connect to sim.openecry.com using 3.5 version of the API. Aug 19, 2010 @ 11:27 AM (Total replies: 3)

Hello,

I am unable to connect to the OEC server "sim.openecry.com" using API 3.5. The only event that fires is the OnDisconnected event with Unexpected set to true.

Using the exact same source code and credentials, I am able to connect using API 3.4.

What am I doing wrong?

John

User Interface » accessing cold fusion web service Jul 02, 2010 @ 12:21 AM (Total replies: 0)

Hello,

not sure where to post this, but we are trying to access a web service to submit our leads using a script. We were given this web service, but we can not get the WSDL to return when calling. Can you supply an example of calling this web service, or give us the correct web service to call?

Web Service URL: http://www.openecry.com/webservices/demosetup.cfc?wsdl

Method name: demosetup

Paremeters:

AccessCode=

NewUserCategoryName=

TemplateUserName=

CusType=

WLabelID=

SCodeID=(Sales codeID if any or just leave )

SoftID=

FName=#Client's first name#

LName=#Client's last name#

Email=#Client's email#

Phone=

Address=

City=

State=

Zip=

Country=

CountryName=

AssetTypes=

How=

MoreEmail=

RemoteAddr=#Client IP Address#

CampaignID=



The response is struct as below:

DemoUName

DemoPass

FutAcct

FXAcct

UUID

Result



Thanks,
John

John

User Interface » How do I debug Custom Indicators written in C# Jun 04, 2010 @ 10:56 AM (Total replies: 5)

I have more details...

I'm running Windows Vista. Not sure if that makes a difference with it's different security model. Also, I'm not using a deployed indicator. I'm just writing and indicator myself so there is no way to set it to "Trust" as it is not a deployed binary.

Attached is the exception that gets thrown when I use the following code...

using(StreamWriter w = File.AppendText("log.txt"))
{
w.WriteLine("Contructor Called");
w.Close();
}

This same exception is thrown if I have it in the Recalculate Method. Is there a security attribute on the method that I need to set or something?

There is no exception thrown if I use the "Log" and "Print" methods of the CustomIndicator class (at least no exception that is not caught). I just can't find the ci file that gets created.

There is something else going on here and I think it has to do with Vista security. I tried running OECTrader with Administrator privileges, but that didn't work either.

Let me know if you have any other suggestions.

Thanks,
John

Here is the exception....

An error occurred. Please contact support with following information:

6/4/2010 9:45:30 AM, Rhythm Trader Demo 3.5 Ver:3.5.0.9, User:JGronemus12, OS: Microsoft Windows NT 6.0.6002 Service Pack 2
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at System.IO.File.AppendText(String path)
at OEC.Chart.Custom.Sandbox.LOSKP..ctor()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The first permission that failed was:
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Append="C:\Program Files\Rhythm Trader\Demo 3.5\log.txt"/>

The demand was for:
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Append="C:\Program Files\Rhythm Trader\Demo 3.5\log.txt"/>

The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Read="C:\Users\jgronemus\AppData\Local\OEC\CustomIndicators\bin.3.5.0.9\;C:\Program Files\OEC\Plugins\demo 3.5\;C:\Program Files\Rhythm Trader\Demo 3.5\"
PathDiscovery="C:\Users\jgronemus\AppData\Local\OEC\CustomIndicators\bin.3.5.0.9\;C:\Program Files\OEC\Plugins\demo 3.5\;C:\Program Files\Rhythm Trader\Demo 3.5\"/>
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Execution"/>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Window="AllWindows"/>
<IPermission class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
PublicKeyBlob="002400000480000094000000060200000024000052534131000400000100010019C33EAC3BD6CD5E685AF01C9BE78CEEE0A937EA92FD9CB60BCE384A49D5B1189A903A64BCCD5D24C939B9A2C0483F5A628C8CDFD195F243D1A3715EAE163DB44A01D2E665A0C072D32B559A1764E061175D0AF271E2410D3B6685EF1AED36E97C01AC55E0E893C5A269E8CC65C44A70BF200EB5443BF128EF9EB7916E207FCD"
Name="Trader"
AssemblyVersion="3.5.0.9"/>
<IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Url="C:\Users\jgronemus\AppData\Local\OEC\CustomIndicators\bin.3.5.0.9\LOSKP.ind"/>
<IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Zone="MyComputer"/>
</PermissionSet>

The assembly or AppDomain that failed was:
LOSKP, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
The Zone of the assembly that failed was:
MyComputer
The Url of the assembly that failed was:
C:\Users\jgronemus\AppData\Local\OEC\CustomIndicators\bin.3.5.0.9\LOSKP.ind
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at OEC.Chart.TimeSeriesFactory.Create(Type type)
at OEC.Chart.TimeSeriesFactory.Create(TimeSeriesAttribute attribute)
at OEC.Chart.ChartPanel.AddIndicator(TimeSeriesAttribute attribute, AreaProfile SelectedArea, TimeSeriesBase SelectedTimeSeries)
at OEC.Chart.ChartPanel.actIndicatorAdd_CaseClick(Action sender, Object Case)
at OEC.UI.Actions.Action.OnCaseClick(Object obj)
at OEC.UI.Actions.ActionSupportToolStripItem.ClickCase(Object sender, EventArgs args)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)





John

User Interface » How do I debug Custom Indicators written in C# Jun 03, 2010 @ 02:34 PM (Total replies: 5)

Can you give a code example? I tried the following and was not able to find the *.ci file.

// Can't find Log file.
public override void Recalculate(RecalculateArg arg)
{
Print(arg.Stock);
}


// Can't find Log file.
public override void Recalculate(RecalculateArg arg)
{
Log.WriteLine("Hello From Recalculate");
}


I tried this and was able to produce the *.ci file after I exited the program...


// Can't find Log file.
public override void Recalculate(RecalculateArg arg)
{
throw new Exception("Hello From Recalculate");
}


thanks,
John

John

User Interface » How do I debug Custom Indicators written in C# May 27, 2010 @ 11:12 AM (Total replies: 5)

Hello,

I'm writing some custom indicators in C#. How do I debug the code? I tried writing variables to a file, but there are security exceptions thrown. I tried displaying variables in a messagebox, but same security problem.

It is difficult to debug the logic if I can't see the variable values.

Thanks
John

John

API Support » Changing the series type from a custom indicator Mar 25, 2010 @ 11:58 AM (Total replies: 1)

Hello,

Is there a way to change the type of chart from a customindicator derived class?

For example, 5 MIN ES is displaying as a candlestick. Is there a way to change that to a HL type programmatically?

Regards,
John

John

API Support » Recalculate Method of CustomIndicator class Mar 23, 2010 @ 10:07 AM (Total replies: 1)

Hello,

I'm trying to write a custom indicator and I'm having some difficulty understanding the parameters that are passed into the method in RecalculateArg. Here is a specific example...

Say I have a data series of 20 bars (0 - 19 with 19 being the earliest in time).

When is Recalculate called?

What would the value of arg.End be?

What would the value of arg.Start be?

What is the value of arg.Stock? Is arg.Stock all the bars in the series all the time? Or is it just the bars that need to be recalculated?

The indicator that I'm trying to write needs to analyze all the bars in the series for each bar. So if bar 0 needs to be recalculated, I need a way to analyze bars 0 - 18. Is there a way to do this?

Thanks,
John

John

Advanced Order Management » Order Execution Flags - How do I use them? Apr 01, 2008 @ 01:11 AM (Total replies: 3)

When will you support the AON flag? It is in your documentation.

John

Advanced Order Management » Order Execution Flags - How do I use them? Mar 27, 2008 @ 01:09 AM (Total replies: 3)

I would like to submit a limit order to buy or sell multiple contracts...2 or 3 at a time. I do not want to get a partial fill. I want the entire order filled or none of the order. The order can stay open indefinitely until filled. How do I send in the Order to guarantee no partial fills?

I tried Limit Order with AON flag and the order gets rejected. The other flags don't seem to give the desired result either.

How can I do this?

John