Test posting source code
I am testing post the source code here:
From Jupyter notebook
import lseg.data as ld from lseg.data.content import historical_pricing import pandas as pd print(ld.__version__) ld.open_session() ld.get_data( universe=['/BTC='], fields=['BID','ASK'] )
From Visual Studio 2022
Log.Level = NLog.LogLevel.Debug; try { // Create the platform session. using ISession session = Sessions.GetSession(); // Open the session session.Open(); // Retrieve tick pricing events. Default: 20 rows of data. Specified trades only and specific columns of data. var response = Events.Definition("BTC=") .EventTypes(Events.EventType.trade) .Fields("RTL", "EVENT_TYPE", "TRDPRC_1", "TRDVOL_1", "QUALIFIERS") .GetData(); Common.DisplayTable("Historical Trade events", response); // Retrieve tick events for a group of instruments.. response = Events.Definition().Universe("/BTC=").GetData(); Common.DisplayTable("Historical events for multiple instruments", response); } catch (Exception e) { Console.WriteLine($"\n**************\nFailed to execute."); Console.WriteLine($"Exception: {e.GetType().Name} {e.Message}"); if (e.InnerException is not null) Console.WriteLine(e.InnerException); Console.WriteLine("***************"); }
From IntelliJ IDEA
AppClient appClient = new AppClient();
consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig() .host("localhost:14002").username("user"));
ElementList view = EmaFactory.createElementList();
OmmArray array = EmaFactory.createOmmArray();
array.fixedWidth(2);
array.add(EmaFactory.createOmmArrayEntry().intValue(22));
array.add(EmaFactory.createOmmArrayEntry().intValue(25)); view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array)); ReqMsg reqMsg = EmaFactory.createReqMsg();
reqMsg.domainType(EmaRdm.MMT_MARKET_PRICE)
.serviceName("ELEKTRON_DD")
.name("JPY=")
.payload(view)
.priority(1, 1)
.initialImage(true)
.interestAfterRefresh(true);
long handle = consumer.registerClient(reqMsg, appClient);
From Visual Studio Code
import WebSocket from "ws";
const ws = new WebSocket("ws://localhost:15000/WebSocket","tr_json2");
import { networkInterfaces } from "os";
const netInterfaces = networkInterfaces();
const [{ address }] = Object.values(netInterfaces).flatMap((netInterface) =>
netInterface!.filter((prop) => prop.family === "IPv4" && !prop.internal)
);
let ric: string = "/LSEG.L";
let snapshot: boolean = false;
const servicename: string = "ELEKTRON_DD";
ws.on("open", () => {
console.log("Establish a connection success");
loginWS();
});
ws.on("message", (message: string) => {
const parsedMsg = JSON.parse(message);
console.log(`Received message from server: ${JSON.stringify(parsedMsg, null, 2)}`);
for (var index = 0; index < parsedMsg.length; ++index)
processMessage(parsedMsg[index]);
});
From CodeBook
stream = rdp_stream.Definition(
service = None,
api = "streaming.quantitative-analytics.endpoints.financial-contracts",
universe = {
"instrumentType": "FxCross",
"instrumentDefinition": {
"instrumentTag": "USDAUD",
"fxCrossType": "FxSpot",
"fxCrossCode": "USDAUD"
}
},
parameters = None,
extended_params = {
"marketData": {
"fxSpots": [
{
"spotDefinition": {
"fxCrossCode": "AUDUSD",
"Source": "Composite"
}
}
]
}
},
view = ["InstrumentTag", "FxSpot_BidMidAsk", "ErrorCode", "Ccy1SpotDate", "Ccy2SpotDate"],
).get_stream()
Note:
- From the code book, need to choose "codeblock" format and paste to keep the format.
- If you paste before format "codeblock", all format are lost.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛