4 Commits

Author SHA1 Message Date
Gunther Schulz c845eadfc6 add feature to correct historical tick data
some brokers (markets.com) deliver tick incorrect historical tick data. this commit attempts to automatically correct the tick price data
2020-11-19 14:38:46 +01:00
Gunther Schulz 2510e59cd6 fix indicator plots starting at the wrong timestamp under certain cond.
plots would shift if the processing of indicaters would shift, if a new candle would for in MT while processing of indicator data of the client was still in process. The fix ensure, that any new indicator data starts at the correct timestamp.
2020-11-19 14:38:15 +01:00
Gunther Schulz de0f3468f1 improve indicator display for more clarity
Removed unused buffer value placeholder
Removed 0 as first indicator value
2020-11-08 20:37:05 +01:00
Gunther Schulz 3b85a93e97 add support for indicator short name
apply styler 
shortened indicator refresh. indicators draw much faster now
2020-11-08 13:31:20 +01:00
2 changed files with 28 additions and 24 deletions
+18 -17
View File
@@ -109,23 +109,6 @@ ControlErrors mControl;
//+------------------------------------------------------------------+
bool BindSockets()
{
sysSocket.setLinger(1000);
dataSocket.setLinger(1000);
liveSocket.setLinger(1000);
streamSocket.setLinger(1000);
indicatorDataSocket.setLinger(1000);
chartDataSocket.setLinger(1000);
chartIndicatorDataSocket.setLinger(1000);
// Number of messages to buffer in RAM.
sysSocket.setSendHighWaterMark(1000);
dataSocket.setSendHighWaterMark(1000);
liveSocket.setSendHighWaterMark(1000);
streamSocket.setSendHighWaterMark(1000);
indicatorDataSocket.setSendHighWaterMark(1000);
chartDataSocket.setReceiveHighWaterMark(1000); // TODO confirm settings
chartIndicatorDataSocket.setReceiveHighWaterMark(1000);
bool result = false;
result = sysSocket.bind(StringFormat("tcp://%s:%d", HOST,SYS_PORT));
if(result == false)
@@ -191,6 +174,23 @@ bool BindSockets()
Print("Bound 'JsonAPIIndicator Data' socket on port ", CHART_INDICATOR_DATA_PORT);
}
sysSocket.setLinger(1000);
dataSocket.setLinger(1000);
liveSocket.setLinger(1000);
streamSocket.setLinger(1000);
indicatorDataSocket.setLinger(1000);
chartDataSocket.setLinger(1000);
chartIndicatorDataSocket.setLinger(1000);
// Number of messages to buffer in RAM.
sysSocket.setSendHighWaterMark(1);
dataSocket.setSendHighWaterMark(5);
liveSocket.setSendHighWaterMark(1);
streamSocket.setSendHighWaterMark(50);
indicatorDataSocket.setSendHighWaterMark(5);
chartDataSocket.setReceiveHighWaterMark(1); // TODO confirm settings
chartIndicatorDataSocket.setReceiveHighWaterMark(1);
return result;
}
@@ -1122,6 +1122,7 @@ void HistoryInfo(CJAVal &dataObject)
data[i][0]=(long) tickArray[i].time_msc;
data[i][1]=(double) tickArray[i].bid;
data[i][2]=(double) tickArray[i].ask;
i++;
}
d["data"].Set(data);
}
+10 -7
View File
@@ -42,12 +42,7 @@ bool setFormingCandleBlank = true;
int OnInit()
{
// TODO subscribe only to own IndicatorId topic
// Subscribe to all topics
chartSubscriptionSocket.setSubscribe("");
chartSubscriptionSocket.setLinger(1000);
// Number of messages to buffer in RAM.
chartSubscriptionSocket.setReceiveHighWaterMark(1000); // TODO confirm settings
bool result = chartSubscriptionSocket.connect(StringFormat("tcp://%s:%d", HOST, CHART_SUB_PORT));
if(result == false)
{
@@ -55,7 +50,15 @@ int OnInit()
}
else
{
Print("Accepting Chart Indicator data on port ", CHART_SUB_PORT);
if(debug)
Print("Accepting Chart Indicator data on port ", CHART_SUB_PORT);
// TODO subscribe only to own IndicatorId topic
// Subscribe to all topics
chartSubscriptionSocket.setSubscribe("");
//chartSubscriptionSocket.setLinger(1000);
chartSubscriptionSocket.setLinger(10000);
// Number of messages to buffer in RAM.
chartSubscriptionSocket.setReceiveHighWaterMark(5); // TODO confirm settings
}
//--- indicator buffers mapping;