API Support Forum
User Profile

Viewing User Profile for: PDavies541


About

Feb 01, 2013 11:34 AM

Jun 22, 2020 09:00 AM

Jun 22, 2020 09:00 AM



Post Statistics
PDavies541 has contributed to 21 posts out of 5677 total posts (0.37%) in 4310 days (0.00 posts per day).

20 most recent posts:

API Support » Ticks, DOM messages stop when a historical tick request is made Jun 22, 2020 @ 09:00 AM (Total replies: 1)

Hi

We are experiencing an issue we've never seen before. Or we didn't notice - but it's pretty significant.

When we start up our DOM, we request real time ticks and DOM messages. We also request tick history for the session. Here's the request:

ISubscription historySubscription = client.Subscriptions.Ticks.Subscribe(
contract.ID,
new Duration(TimeZoneInfo.ConvertTimeToUtc(subscription.DateTimeFrom), TimeZoneInfo.ConvertTimeToUtc(subscription.DateTimeTo), 65536,Continuity.OneTime));


Let's say we have 4 DOMS running in our app (all with different instruments) and the user runs number 5 (with another different instrument). Let's also say that it takes 10 seconds before the historical tick data is returned.

During those 10 seconds, we do not see any DOM or real-time tick events for ANY instrument. The entire API appears to hang until the historical ticks request is returned.

This is something I feel we would have noticed before and it's become apparent only in the past 2 weeks.

Is this something we can resolve?

Let me know

Pete
Peter Davies


API Support » matching positions across sessions Aug 10, 2018 @ 04:19 PM (Total replies: 2)

Hi
We are currently looking at integrating Futures options.

When a position is created, we might (for example) get 3 fills

Position 1 Qty 11
- Fill A 3
- Fill B 6
- Fill C 2

1 position, 3 fills.

Then - the next day when we open the API, we have the same position but only 1 fill

Position 1 Qty 11
- Fill A - 11

Also - the dateTime of Fill A does not match the datetime of any of the fills from the prior day - it's close but different.

So - this makes it hard to know if a position that existed the prior day is the same as the one that exists today. Could be the same one but could be different. This is even more difficult if orders were filled when the platform was closed and the position qty is now different.

Is there a way to match positions across sessions - any id that we are missing?

Thanks

Pete
Peter Davies


API Support » Trailing Orders - Not Trailing Apr 12, 2018 @ 08:03 AM (Total replies: 2)

Hi All

Thanks for your help with the last issue we had with trailing orders. We are now submitting trailing orders ok - but we get no event or notification that the order has trailed.

https://youtu.be/iXDUF9wYNi0

Now - maybe I'm wrong - but shouldn't I be getting events back informing me of the new order price? Or is this order simply not trailing?

Let me know

Peter
Peter Davies


API Support » Trailing Stop Orders being rejected Apr 10, 2018 @ 12:14 AM (Total replies: 0)

Hi

We are struggling with trailing stop orders.

Here is the part of the code where we set the trailing parameters

if (order.TrailTicks > 0 && order.OrderType == JTEnumerations.OrderType.Stop)
{

myOrderDraft.SetTSData(myOrderDraft.Contract.CurrentPrice.LastPrice, (double)(order.TrailTicks - myOrderDraft.Contract.TickSize));
}

OEC.API.OrderParts myInvalidOrderParts = myOrderDraft.GetInvalidParts();

if (myInvalidOrderParts != OEC.API.OrderParts.None)
{
JTLogger.AppLog("JTOECOrderHandler.OrderSubmit: Order Error - myInvalidOrderParts: " + myInvalidOrderParts.ToString());
}


What's happening is we always end up with the "Extendedparameters" error coming back from GetInvalidParts

Any idea what we are doing wrong?

We are testing with a demo futures account with the ESM8 contract.

Cheers

Pete
Peter Davies


API Support » Trailing Stop Orders being rejected Apr 10, 2018 @ 12:14 AM (Total replies: 1)

Hi

We are struggling with trailing stop orders.

Here is the part of the code where we set the trailing parameters

if (order.TrailTicks > 0 && order.OrderType == JTEnumerations.OrderType.Stop)
{

myOrderDraft.SetTSData(myOrderDraft.Contract.CurrentPrice.LastPrice, (double)(order.TrailTicks - myOrderDraft.Contract.TickSize));
}

OEC.API.OrderParts myInvalidOrderParts = myOrderDraft.GetInvalidParts();

if (myInvalidOrderParts != OEC.API.OrderParts.None)
{
JTLogger.AppLog("JTOECOrderHandler.OrderSubmit: Order Error - myInvalidOrderParts: " + myInvalidOrderParts.ToString());
}


What's happening is we always end up with the "Extendedparameters" error coming back from GetInvalidParts

Any idea what we are doing wrong?

We are testing with a demo futures account with the ESM8 contract.

Cheers

Pete
Peter Davies


API Support » OCO Orders Feb 27, 2018 @ 09:35 AM (Total replies: 1)

Hi

I'm struggling a little with OCO Orders - I'm not 100% sure if I need to do something to properly link them.

It seems to create OCO Orders of type "Cancel Cancels Other" whereas the OEC DOM seems to create them as "Fill or Cancel Cancels Other".


public void OrderSubmitOCO(List orders, JTEnumerations.OCOType type, string ocoId)
{
Dictionary ocoOrders = new Dictionary();
foreach (JTOrder ocoOrder in orders)
{
OEC.API.OrderDraft myOrderDraft = GetOECOrder(ocoOrder); // Creates OEC order from our internal order format
OEC.API.OrderParts myInvalidOrderParts = myOrderDraft.GetInvalidParts();
if (myInvalidOrderParts != OEC.API.OrderParts.None)
{
JTLogger.AppLog("JTOECOrderHandler.OrderSubmit: Order Error - myInvalidOrderParts: " + myInvalidOrderParts);
}
else
ocoOrders.Add(ocoOrder.InternalID, myOrderDraft);
}
client.SendOCOOrders(ocoOrders.Values.ToArray());
}


We are presuming this will link the orders together.

Any thoughts?

Thanks

Peter
Peter Davies


API Support » Symbol Search Sep 22, 2017 @ 06:10 AM (Total replies: 1)

Hi

We have your sample app and we are using the symbol search.

A search for Futures contracts, exchange CME, with a search string of * returns 116 rows.

We do the same thing on our side, it returns 51 rows.

We tried putting in our UUID, username & password into the sample app and it still returned 116 rows but on our app we get 51. We even tried the UUID from the sample app in our app but still got 51 rows.

I understand there is a limit of 50 rows. Is that by UUID or username? Or something else?

Is this limit going to be the same on the customer side? It does seem a bit odd to limit the amount of symbols a search will return. Is there any way to extend the limit?

Cheers

Pete
Peter Davies


API Support » Symbol Mapping Sep 20, 2017 @ 09:42 AM (Total replies: 1)

In the OEC feed, some symbols are renamed. Like CL is GCL.

Is there a property available that gives us the original symbol or symbol root? The "CL" part?

I need it for mapping back to the symbols in my own database...

If not, are the mappings documented?

Cheers

Pete
Peter Davies


API Support » Symbol Search Apr 26, 2017 @ 10:34 AM (Total replies: 1)

I am looking to use the SymbolLookup to populate our internal instrument database.

The following information would really help us.

1 - A list of exchanges used (and what each represents). I think this is the list:
CBL - CBOT?
CFE - ?
CME - CME
COE - COMEX?
EUR- EUREX
EURCMD - ?
EUREID - ?
ICECA - got it
ICEEUC - got it
ICEEUF - got it
ICEEUS - got it
IPE - got it
MGF
NYM - NYMEX?
OSE - Osaka?

I am not 100% sure what some of them are.

2 - The maximum value for "DesiredResultCount" if any.

Thanks

Pete
Peter Davies


FIX Support » Problem Connecting to Fix - Jan 20, 2014 @ 04:44 AM (Total replies: 3)

Victor - Can I ask what makes you say that.

If you look @ the screen shots, the 553 is in there and also it's on the logs...

Summary
OUT 20140115-05:52:37.245032900 8=FIX.4.4 9=10935=A 49=PDavies541Data 56=OEC_TEST 34=1 52=20140115-05:52:37.244 98=0 108=3 0 553=PDavies541Data 554=API2303910=182

I'm not disagreeing with you - I just want to understand the issue & how you think the 553 tag isn't there in the logon message.

Thanks

Pete

Peter Davies

FIX Support » Problem Connecting to Fix - Jan 16, 2014 @ 07:26 PM (Total replies: 3)

We have recently started our testing with OEC FIX and are running into issues getting connected to the FIX API. We cannot seem to connect to the test servers right now.

Order Access (non SSL)


Session Summary:
OUT 20140115-05:36:17.523413500 8=FIX.4.49=101 35=A 49=PDavies541 56=OEC_TEST 34=1 52=20140115-05:36:17.510 98=0 108=30 553=PDavies541 554=API23039 10=182
OUT 20140115-05:36:53.512560300 8=FIX.4.49=133 35=5 49=PDavies541 56=OEC_TEST 34=2 52=20140115-05:36:53.512 58=the acknowledgment Logon message has not been received during 36 sec10=063

Log
INFO: 20140115-06:01:39.861713874: Session <PDavies541Data, OEC_TEST, FIX.4.4> : EncryptionMethod is set to NONE.
INFO: 20140115-06:01:43.925407834: Session <PDavies541, OEC_TEST, FIX.4.4> : connected as Initiator.
INFO: 20140115-06:01:43.925455580: Session <PDavies541, OEC_TEST, FIX.4.4> : the telecommunication link is established to host api.openecry.com, port 9300.
INFO: 20140115-06:01:43.925484108: Session <PDavies541, OEC_TEST, FIX.4.4> : InSeqNum is set to 1.
INFO: 20140115-06:01:43.925500023: Session <PDavies541, OEC_TEST, FIX.4.4> : State is changed from Disconnected to AwaitConfirmingLogin.
ERROR: 20140115-06:02:19.925932744: Session <PDavies541, OEC_TEST, FIX.4.4> : Cannot logon: the acknowledgment Logon message has not been received during 36 sec.
WARNING: 20140115-06:02:19.931002568: Session <PDavies541, OEC_TEST, FIX.4.4> : the telecommunication link error is detected: the acknowledgment Logon message has not been received during 36 sec.
INFO: 20140115-06:02:20.032054009: Session <PDavies541, OEC_TEST, FIX.4.4> : State is changed from AwaitConfirmingLogin to Disconnected.
INFO: 20140115-06:02:20.032105659: Session <PDavies541, OEC_TEST, FIX.4.4> : disconnected (the acknowledgment Logon message has not been received during 36 sec).


Order Access (SSL)


Session Summary:
OUT 20140115-05:47:35.296923000 8=FIX.4.4 9=101 35=A 49=PDavies541 56=OEC_TEST 34=1 52=20140115-05:47:35.294 98=0 108=30 553=PDavies541 554=API23039 10=193
OUT 20140115-05:48:11.296485200 8=FIX.4.4 9=133 35=5 49=PDavies541 56=OEC_TEST 34=2 52=20140115-05:48:11.296 58=the acknowledgment Logon message has not been received during 36 sec 10=069

Log:

INFO: 20140115-05:58:50.310545670: Session <PDavies541, OEC_TEST, FIX.4.4> : connected as Initiator.
INFO: 20140115-05:58:50.310578402: Session <PDavies541, OEC_TEST, FIX.4.4> : the telecommunication link is established to host api.openecry.com, port 9400.
INFO: 20140115-05:58:50.310600323: Session <PDavies541, OEC_TEST, FIX.4.4> : InSeqNum is set to 1.
INFO: 20140115-05:58:50.310613236: Session <PDavies541, OEC_TEST, FIX.4.4> : State is changed from Disconnected to AwaitConfirmingLogin.
ERROR: 20140115-05:59:26.310117454: Session <PDavies541, OEC_TEST, FIX.4.4> : Cannot logon: the acknowledgment Logon message has not been received during 36 sec.
WARNING: 20140115-05:59:26.313632969: Session <PDavies541, OEC_TEST, FIX.4.4> : the telecommunication link error is detected: the acknowledgment Logon message has not been received during 36 sec.
INFO: 20140115-05:59:26.414307544: Session <PDavies541, OEC_TEST, FIX.4.4> : State is changed from AwaitConfirmingLogin to Disconnected.
INFO: 20140115-05:59:26.414354990: Session <PDavies541, OEC_TEST, FIX.4.4> : disconnected (the acknowledgment Logon message has not been received during 36 sec).

Data Access


Summary
OUT 20140115-05:52:37.245032900 8=FIX.4.4 9=10935=A 49=PDavies541Data 56=OEC_TEST 34=1 52=20140115-05:52:37.244 98=0 108=3 0 553=PDavies541Data 554=API2303910=182

Log
INFO: 20140115-05:55:45.716675458: Session <PDavies541Data, OEC_TEST, FIX.4.4> : EncryptionMethod is set to NONE.
INFO: 20140115-05:55:50.605526410: Session <PDavies541Data, OEC_TEST, FIX.4.4> : connected as Initiator.
INFO: 20140115-05:55:50.605558541: Session <PDavies541Data, OEC_TEST, FIX.4.4> : the telecommunication link is established to host api.openecry.com, port 9301.
INFO: 20140115-05:55:50.605589771: Session <PDavies541Data, OEC_TEST, FIX.4.4> : InSeqNum is set to 1.
INFO: 20140115-05:55:50.605604185: Session <PDavies541Data, OEC_TEST, FIX.4.4> : State is changed from Disconnected to AwaitConfirmingLogin.
INFO: 20140115-05:56:20.870462315: Session <PDavies541Data, OEC_TEST, FIX.4.4> : State is changed from AwaitConfirmingLogin to Disconnected.
ERROR: 20140115-05:56:20.870503155: Session <PDavies541Data, OEC_TEST, FIX.4.4> : Cannot logon: after sending the initial Logon message the telecommunication link error is detected (closed by the counterpart).


Any idea what we might be doing wrong? Do the connection details look OK?

Thanks

Pete



Peter Davies
Edited by PDavies541 on Jan 16, 2014 at 19:27:10
Edited by PDavies541 on Jan 16, 2014 at 19:30:06

API Support » Persisting Fonts, Colors and Custom Data Objects Jul 01, 2013 @ 11:08 PM (Total replies: 3)

Hi Victor

Thanks for the reply. I can see what you did to make it work but what I didn't send you was my definition of the Serializable color class or OEC Data class. They are below. I use these classes because I sometimes need to save data into my own XML file and also in the OEC workspace.

When I use the files as listed below they are not recognized in the OEC XML file but save fine to local storage.

Thanks again

[Serializable()]
/// <summary>
/// JTSerializableColor
/// </summary>
/// <remaks>
/// Wrapper clas to serialize and deserialize
/// the Color structure. Color structure can not be XML
/// serialized because it does not have any public
/// fields and can't be serialized directly.
/// </remaks>
public class JTSerializableColor : ICloneable
{
#region Public Variables
//the ARGB name of the color
public int colorARGB { get; set; }
//color name
public string colorName;
#endregion

#region Constructors

#region Default

/// <summary>
/// JTSerializableColor
/// </summary>
/// <remarks>
/// Default constructor for XML serialization
/// </remarks>
public JTSerializableColor()
{
//do nothing
}
#endregion

#region Normal

/// <summary>
/// JTSerializableColor
/// </summary>
/// <remarks>
/// Constructor used when creating objects
/// </remarks>
/// <param name="name"></param>
public JTSerializableColor(Color name)
{
//set ARGB value
colorARGB = name.ToArgb();
//set name
colorName = name.Name;
}
#endregion

#endregion

#region Public Methods

#region Get Color

/// <summary>
/// GetColor
/// </summary>
/// <remarks>
/// Returns the color from the
/// stored name.
/// </remarks>
/// <returns></returns>
public Color GetColor()
{
//return the color
return Color.FromArgb(colorARGB);
}
#endregion

#region Set Color

/// <summary>
/// SetColor
/// </summary>
/// <remarks>
/// Sets the name from the color
/// </remarks>
/// <param name="color"></param>
public void SetColor(Color color)
{
//set the name
colorARGB = color.ToArgb();
}
#endregion

#region Clone

/// <summary>
/// Clone
/// </summary>
/// <remarks>
/// Shallow copy of this object
/// </remarks>
/// <returns></returns>
public JTSerializableColor Clone()
{
//clone
return (JTSerializableColor)this.MemberwiseClone();
}
#endregion

#endregion

#region IClonable Members

/// <summary>
/// ICloneable.Clone()
/// </summary>
/// <remarks>
/// Interface implementation
/// </remarks>
/// <returns></returns>
object ICloneable.Clone()
{
return Clone();
}
#endregion
}

[Serializable()]
public class OECData : ISerializable
{
private int testInt = 10;


/// <summary>
/// Constructor
/// </summary>
public OECData()
{
}

/// <summary>
/// Constructor
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
public OECData(SerializationInfo info, StreamingContext context)
{
testInt = (int)info.GetValue("TestInt", typeof(int));
}


/// <summary>
///
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("TestInt", testInt);
}

public int TestInt
{
get { return testInt; }
set { testInt = value; }
}
}

Peter Davies

API Support » Persisting Fonts, Colors and Custom Data Objects Jun 18, 2013 @ 12:19 AM (Total replies: 3)

Hi

I'm having trouble saving fonts, colors and custom data objects into an OEC workspace file as XML.

I have tried and tested classes that can serialize fonts, colors and custom data objects that I've successfully used on many other projects but I seem to be having trouble using these in OEC. My simple test indicator code is below.

I would be grateful if you could tell me what I'm going wrong or the preferred way of saving fonts, colors and custom data objects into an OEC workspace.

P.S. I don't get any compile or run time errors with this code.

Thanks in advance

public sealed class JTPersistenceTest : OEC.Chart.Custom.CustomIndicator, IOECPersistence
{
private OECMainForm form = null;

//class to XML srialize colors
private JTSerializableColor testColor = null;
//class to XML serialize data objects
private OECData theData = null;
private int theInt;

protected override void Refresh(DataChangedMode mode)
{
if (form == null)
{
//above variables changed in here
form = new OECMainForm(this);
form.Show();
}
}

public override void Delete()
{
Print("Calling Overriden Delete()");
form.Close();
base.Delete();
}

//this won't save
[XmlSerializable]
public OECData TestData
{
get { return theData; }
set { theData = value;}
}

//this will save
[XmlSerializable]
public int TheInt
{
get { return theInt; }
set { theInt = value; }
}

//this won't save
[XmlSerializable]
public JTSerializableColor TestColor
{
get { return testColor; }
set { testColor = value; }
}
}
}

Peter Davies

API Support » Identifying which server you are connected to... Jun 17, 2013 @ 05:53 AM (Total replies: 1)

Hi

I have some code that is called from an indicator. It uses the API but it doesn't make the connection itself, it uses the connection that the OEC client creates.

How can I tell if we are currently connected to a live or demo server?

Thanks

Pete

Peter Davies

API Support » Identifying Demo accounts/other account types Jun 11, 2013 @ 08:04 AM (Total replies: 2)

Got it - so my next question is - how do I know whether the customer is connected to developer, demo or production server?

Our code is implemented via indicators and we are using OEC.API.OECClient.Global to access events, orders etc. We don't make the connection ourselves, we just use the existing connection.

Is there a property that tells us the server type we are connected to?

Thanks

Pete


Peter Davies
Edited by PDavies541 on Jun 11, 2013 at 08:11:54

API Support » Identifying Demo accounts/other account types Jun 06, 2013 @ 02:17 AM (Total replies: 2)

Is there some property on the account object that identifies that it is a live account or a SIM/DEMO account?

I cannot find anything other than the demo accounts tend to start with "DEMO".

Many thanks

Pete

Peter Davies

API Support » Chart Markers Jun 06, 2013 @ 02:14 AM (Total replies: 2)

Brilliant! Works a treat, thanks for taking time to replu.

Peter Davies

API Support » Populating the Alert Window May 29, 2013 @ 11:05 PM (Total replies: 1)

Hi

I have software that generates alerts. These are based on certain order flow conditions/events.

I am currently just using "Print" to populate the log (my code is embedded in an indicator).

As there is already an alert window in OEC, I'd like to push alerts there. I won't be creating any alert conditions ahead of time. Is it possible to push messages to the alerts window at all? Then the users will see their pre-defined price alerts and my generated alerts in the same place.

Cheers

Pete

Peter Davies

API Support » Chart Markers May 29, 2013 @ 10:38 PM (Total replies: 2)

Hi

I have some indicator code that needs to put markers on the chart.

I understand that I can use graphics commands to do this as well as to find the boundaries of the chart but I actually need to put markers at specific prices on specific bars.

For example, I have an iceberg order alert which shows where an iceberg order is. It's important that this appears at the time/price the iceberg occured.

I can't find any documentation on how to do this, how to calculate the co-ordinates.

Can you help?

Cheers

Pete

Peter Davies

Market Data » When is current price available? May 29, 2013 @ 10:33 PM (Total replies: 2)

OK - got it, many thanks!

Peter Davies