Skip to content

Commit

Permalink
Merge pull request #610 from ademeshkib/DelayedLastTimestamp
Browse files Browse the repository at this point in the history
Delayed last timestamp
  • Loading branch information
aantropovib authored Feb 7, 2018
2 parents b9c81ce + 9ada3f8 commit 96a0edc
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions samples/Cpp/TestCppClient/TestCppClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1312,14 +1312,14 @@ void TestCppClient::nextValidId( OrderId orderId)
m_orderId = orderId;
//! [nextvalidid]

m_state = ST_TICKOPTIONCOMPUTATIONOPERATION;
//m_state = ST_TICKOPTIONCOMPUTATIONOPERATION;
//m_state = ST_TICKDATAOPERATION;
//m_state = ST_REQTICKBYTICKDATA;
//m_state = ST_REQHISTORICALTICKS;
//m_state = ST_CONTFUT;
//m_state = ST_PNLSINGLE;
//m_state = ST_PNL;
//m_state = ST_DELAYEDTICKDATAOPERATION;
m_state = ST_DELAYEDTICKDATAOPERATION;
//m_state = ST_MARKETDEPTHOPERATION;
//m_state = ST_REALTIMEBARS;
//m_state = ST_MARKETDATATYPE;
Expand Down
Binary file modified samples/Excel/TwsActiveX.xls
Binary file not shown.
1 change: 1 addition & 0 deletions samples/Java/apidemo/TopModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ public String change() {
@Override public void tickString(TickType tickType, String value) {
switch( tickType) {
case LAST_TIMESTAMP:
case DELAYED_LAST_TIMESTAMP:
m_lastTime = Long.parseLong( value) * 1000;
break;
default: break;
Expand Down
1 change: 1 addition & 0 deletions samples/VB/VB_API_Sample/Utils.vb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Friend Class Utils
LastRegTime
FuturesOpenInterest
AvgOptVolume
DelayedLastTimestamp
Unknown
End Enum

Expand Down
1 change: 1 addition & 0 deletions source/cppclient/client/EWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ enum TickType { BID_SIZE, BID, ASK, ASK_SIZE, LAST, LAST_SIZE,
LAST_REG_TIME,
FUTURES_OPEN_INTEREST,
AVG_OPT_VOLUME,
DELAYED_LAST_TIMESTAMP,
NOT_SET };

typedef std::map<int, std::tuple<std::string, char>> SmartComponentsMap;
Expand Down
4 changes: 3 additions & 1 deletion source/csharpclient/TwsRtdServer/TwsRtdServerData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public class TwsRtdServerData{
public const string DELAYED_VOLUME = "DELAYEDVOLUME";
public const string DELAYED_CLOSE = "DELAYEDCLOSE";
public const string DELAYED_OPEN = "DELAYEDOPEN";
public const string DELAYED_LAST_TIMESTAMP = "DELAYEDLASTTIMESTAMP";

// Option Topics
public const string BID_IMPLIED_VOL = "BIDIMPLIEDVOL";
Expand Down Expand Up @@ -266,7 +267,7 @@ public class TwsRtdServerData{

// delayed topics
DELAYED_BID, DELAYED_ASK, DELAYED_LAST, DELAYED_BID_SIZE, DELAYED_ASK_SIZE, DELAYED_LAST_SIZE,
DELAYED_HIGH, DELAYED_LOW, DELAYED_VOLUME, DELAYED_CLOSE, DELAYED_OPEN
DELAYED_HIGH, DELAYED_LOW, DELAYED_VOLUME, DELAYED_CLOSE, DELAYED_OPEN, DELAYED_LAST_TIMESTAMP
};

private static string[] m_allowedDelayedTopics = new string[]{
Expand Down Expand Up @@ -352,6 +353,7 @@ public class TwsRtdServerData{
{ 74, DELAYED_VOLUME },
{ 75, DELAYED_CLOSE },
{ 76, DELAYED_OPEN },
{ 88, DELAYED_LAST_TIMESTAMP },

{ 78, GEN_TICK_CREDITMAN_MARK_PRICE },
{ 79, GEN_TICK_CREDITMAN_SLOW_MARK_PRICE },
Expand Down
8 changes: 8 additions & 0 deletions source/csharpclient/TwsRtdServer/TwsRtdServerMktDataTicks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class TwsRtdServerMktDataTicks
private int m_delayed_volume = 0;
private double m_delayed_close = 0.0;
private double m_delayed_open = 0.0;
private string m_delayed_lastTimestamp = "";

// constructor
public TwsRtdServerMktDataTicks(){
Expand Down Expand Up @@ -286,6 +287,9 @@ public void SetValue(string tickType, object value)
case TwsRtdServerData.DELAYED_OPEN:
m_delayed_open = (double)value;
break;
case TwsRtdServerData.DELAYED_LAST_TIMESTAMP:
m_delayed_lastTimestamp = (string)value;
break;
}
}

Expand Down Expand Up @@ -577,6 +581,10 @@ public Object GetValue(string topicStr)
case TwsRtdServerData.DELAYED_OPEN:
value = m_delayed_open;
break;
case TwsRtdServerData.DELAYED_LAST_TIMESTAMP:
value = m_delayed_lastTimestamp;
break;

}
return value;
}
Expand Down
2 changes: 2 additions & 0 deletions source/csharpclient/client/TickType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public class TickType
public const int LAST_REG_TIME = 85;
public const int FUTURES_OPEN_INTEREST = 86;
public const int AVG_OPT_VOLUME = 87;
public const int DELAYED_LAST_TIMESTAMP = 88;

public static String getField( int tickType) {
switch( tickType) {
Expand Down Expand Up @@ -192,6 +193,7 @@ public static String getField( int tickType) {
case LAST_REG_TIME: return "lastRegTime";
case FUTURES_OPEN_INTEREST: return "futuresOpenInterest";
case AVG_OPT_VOLUME: return "avgOptVolume";
case DELAYED_LAST_TIMESTAMP: return "delayedLastTimestamp";

default: return "unknown";
}
Expand Down
1 change: 1 addition & 0 deletions source/javaclient/com/ib/client/TickType.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public enum TickType {
LAST_REG_TIME(85, "lastRegTime"),
FUTURES_OPEN_INTEREST(86, "futuresOpenInterest"),
AVG_OPT_VOLUME(87, "avgOptVolume"),
DELAYED_LAST_TIMESTAMP(88, "delayedLastTimestamp"),

UNKNOWN( Integer.MAX_VALUE , "unknown" );

Expand Down

0 comments on commit 96a0edc

Please sign in to comment.