Disable study_templates by default #682
click "Symbol Info..." cause exception and can not close #680 Add Momentum to Library #677 onTick doesn't work #670 Overnight daily bars are displayed incorrectly on timescale #661 Bar marks are shifted #654 More data is requested when changing a timezone #652 Bar marks are moved to the last bar when switching time zone #651 Missing data #646 Double click on bar marks shows empty dialog (unstable only) #644 Option to disable savings of drawings created with API #643 Option to disable selection of drawings created with API #642 Add API for text drawings #640 Create a featureset to save favorite chart styles and study templates (+ watch in terminal) to local storage #626 Featureset show_dialog_on_snapshot_ready doesn't work #625 Implement the API call to inject custom CSS #619 Add executeActionById method #618 Two-columned layout is not working #599 Request for study templates persists even of they are switched off #598 Widget Event method callbacks for onIntervalChange, onAutoSaveNeeded, saveChart are not executed sometimes and intermittent in IE. #597 Option to remove market status indicator #589 Chart doesn't load on firefox #587 Cannot Retrieve Current Symbol from widget #585 drowing problem with lines end on mousemove, reproduced on official site #577 HotKeys support and customization of hotkeys #568 Return "Remove All Drawing Tools" #556 Empty bar for drawing instruments #551 Screen shot API function #548 Crosshair remain white points between sections #533 Create a line like (Support and Resistance) and this line wont be included in the Save State Chart #527 Chart doesn't unsubscribe from datafeed on destroy #512 Tickmarks in future are cleared after scrolling for more data #489 Сlick outside the chart widget does not close popups #465 Webkit bug use isFavorite of chart type #460 Auto Focus when mouse cursor is inside the chart. #452 Allow drawing rectangles and other 2 points shapes #448 Create horizontal break line with onContextMenu() #435 Implement an ability to set zOrder for created shapes #413 Resize Chart when its container is resized #372 Support for showing split, dividends, and earnings... #286 Disable tools #151 Significant memory leak on iframe reload #120
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
"use strict";
|
||||
/*
|
||||
This class implements interaction with UDF-compatible datafeed.
|
||||
|
||||
@@ -5,7 +6,7 @@
|
||||
https://github.com/tradingview/charting_library/wiki/UDF
|
||||
*/
|
||||
|
||||
Datafeeds = {};
|
||||
var Datafeeds = {};
|
||||
|
||||
Datafeeds.UDFCompatibleDatafeed = function(datafeedURL, updateFrequency, protocolVersion) {
|
||||
|
||||
@@ -30,7 +31,8 @@ Datafeeds.UDFCompatibleDatafeed.prototype.defaultConfiguration = function() {
|
||||
supports_search: false,
|
||||
supports_group_request: true,
|
||||
supported_resolutions: ["1", "5", "15", "30", "60", "1D", "1W", "1M"],
|
||||
supports_marks: false
|
||||
supports_marks: false,
|
||||
supports_timescale_marks: false
|
||||
};
|
||||
};
|
||||
|
||||
@@ -173,6 +175,22 @@ Datafeeds.UDFCompatibleDatafeed.prototype.getMarks = function (symbolInfo, range
|
||||
}
|
||||
};
|
||||
|
||||
Datafeeds.UDFCompatibleDatafeed.prototype.getTimescaleMarks = function (symbolInfo, rangeStart, rangeEnd, onDataCallback, resolution) {
|
||||
if (this._configuration.supports_timescale_marks) {
|
||||
this._send(this._datafeedURL + "/timescale_marks", {
|
||||
symbol: symbolInfo.ticker.toUpperCase(),
|
||||
from : rangeStart,
|
||||
to: rangeEnd,
|
||||
resolution: resolution
|
||||
})
|
||||
.done(function (response) {
|
||||
onDataCallback(JSON.parse(response));
|
||||
})
|
||||
.fail(function() {
|
||||
onDataCallback([]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Datafeeds.UDFCompatibleDatafeed.prototype.searchSymbolsByName = function(ticker, exchange, type, onResultReadyCallback) {
|
||||
var MAX_SEARCH_RESULTS = 30;
|
||||
@@ -460,7 +478,7 @@ Datafeeds.SymbolsStorage.prototype._requestFullSymbolsList = function() {
|
||||
return function(response) {
|
||||
that._onExchangeDataReceived(exchange, JSON.parse(response));
|
||||
that._onAnyExchangeResponseReceived(exchange);
|
||||
}
|
||||
};
|
||||
}(exchange))
|
||||
.fail(function(exchange) {
|
||||
return function (reason) {
|
||||
@@ -468,7 +486,7 @@ Datafeeds.SymbolsStorage.prototype._requestFullSymbolsList = function() {
|
||||
};
|
||||
}(exchange));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -494,7 +512,7 @@ Datafeeds.SymbolsStorage.prototype._onExchangeDataReceived = function(exchangeNa
|
||||
|
||||
var hasIntraday = tableField(data, "has-intraday", symbolIndex);
|
||||
|
||||
var tickerPresent = typeof data["ticker"] != "undefined";
|
||||
var tickerPresent = typeof data.ticker != "undefined";
|
||||
|
||||
var symbolInfo = {
|
||||
name: symbolName,
|
||||
@@ -707,18 +725,18 @@ Datafeeds.DataPulseUpdater = function(datafeed, updateFrequency) {
|
||||
})(subscriptionRecord);
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof updateFrequency != "undefined" && updateFrequency > 0) {
|
||||
setInterval(update, updateFrequency);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Datafeeds.DataPulseUpdater.prototype.unsubscribeDataListener = function(listenerGUID) {
|
||||
this._datafeed._logMessage("Unsubscribing " + listenerGUID);
|
||||
delete this._subscribers[listenerGUID];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Datafeeds.DataPulseUpdater.prototype.subscribeDataListener = function(symbolInfo, resolution, newDataCallback, listenerGUID) {
|
||||
@@ -738,7 +756,7 @@ Datafeeds.DataPulseUpdater.prototype.subscribeDataListener = function(symbolInfo
|
||||
}
|
||||
|
||||
this._subscribers[listenerGUID].listeners.push(newDataCallback);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Datafeeds.DataPulseUpdater.prototype.periodLengthSeconds = function(resolution, requiredPeriodsCount) {
|
||||
@@ -758,7 +776,7 @@ Datafeeds.DataPulseUpdater.prototype.periodLengthSeconds = function(resolution,
|
||||
}
|
||||
|
||||
return daysCount * 24 * 60 * 60;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Datafeeds.QuotesPulseUpdater = function(datafeed) {
|
||||
@@ -771,11 +789,11 @@ Datafeeds.QuotesPulseUpdater = function(datafeed) {
|
||||
var that = this;
|
||||
|
||||
setInterval(function() {
|
||||
that._updateQuotes(function(subscriptionRecord) { return subscriptionRecord.symbols; })
|
||||
that._updateQuotes(function(subscriptionRecord) { return subscriptionRecord.symbols; });
|
||||
}, this._updateInterval);
|
||||
|
||||
setInterval(function() {
|
||||
that._updateQuotes(function(subscriptionRecord) { return subscriptionRecord.fastSymbols.length > 0 ? subscriptionRecord.fastSymbols : subscriptionRecord.symbols; })
|
||||
that._updateQuotes(function(subscriptionRecord) { return subscriptionRecord.fastSymbols.length > 0 ? subscriptionRecord.fastSymbols : subscriptionRecord.symbols; });
|
||||
}, this._fastUpdateInterval);
|
||||
};
|
||||
|
||||
@@ -818,7 +836,7 @@ Datafeeds.QuotesPulseUpdater.prototype._updateQuotes = function(symbolsGetter) {
|
||||
for (var i =0; i < subscribers.length; ++i) {
|
||||
subscribers[i](data);
|
||||
}
|
||||
}
|
||||
};
|
||||
}(subscriptionRecord.listeners, listenerGUID),
|
||||
// onErrorCallback
|
||||
function (error) {
|
||||
|
||||
Reference in New Issue
Block a user