ALERT LOG
-
- Posts: 551
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: ALERT LOG
Hi,
if you mean "can I use API to make an indicator which will write all sound Alerts produced by some other entities into Bookmap log (or into a file)" - yes. Sound alerts are usually produced with Layer1ApiSoundAlertMessage messages. So your module will filter all incoming messages and write to log if those are Layer1ApiSoundAlertMessage instances. Usually means here that sometimes sound alerts are played directly with no Layer1ApiSoundAlertMessage used. Let me know if I have misunderstood the question or if you need some further instructions.
if you mean "can I use API to make an indicator which will write all sound Alerts produced by some other entities into Bookmap log (or into a file)" - yes. Sound alerts are usually produced with Layer1ApiSoundAlertMessage messages. So your module will filter all incoming messages and write to log if those are Layer1ApiSoundAlertMessage instances. Usually means here that sometimes sound alerts are played directly with no Layer1ApiSoundAlertMessage used. Let me know if I have misunderstood the question or if you need some further instructions.
-
- Posts: 10
- Joined: Wed Oct 03, 2018 11:03 am
- Has thanked: 1 time
Re: ALERT LOG
hello AndreyRI tried got message from Layer1ApiSoundAlertMessage but I have always many errors.Please could you post sample to get text message sent by Layer1ApiSoundAlertMessage .
thank you
thank you
-
- Posts: 551
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: ALERT LOG
Hi oceanis,
an example attached. LastTradeSoundAlert generates a sound alert for every n-th trade. SoundAlertFilterSimplified filters user messages and logs sound alert instances. SoundAlertFilterSimplified captures alerts for all symbols. So please note if you are running more than one symbol SoundAlertFilterSimplified should be enabled only once (for only one symbol), logging will be duplicated otherwise.
an example attached. LastTradeSoundAlert generates a sound alert for every n-th trade. SoundAlertFilterSimplified filters user messages and logs sound alert instances. SoundAlertFilterSimplified captures alerts for all symbols. So please note if you are running more than one symbol SoundAlertFilterSimplified should be enabled only once (for only one symbol), logging will be duplicated otherwise.
- Attachments
-
- SoundAlertFilterSimplified.java
- (1.25 KiB) Downloaded 307 times
-
- LastTradeSoundAlert.java
- (2.57 KiB) Downloaded 273 times
-
- Posts: 10
- Joined: Wed Oct 03, 2018 11:03 am
- Has thanked: 1 time
Re: ALERT LOG
hello AndreyR,
Thank you very much for this sample.
Is it possible to get real Timestamp of message from Layer1ApiSoundAlertMessage because when you use replay mode you haven't good time.
And how to get Symbol that sent Alert because it's impossible to know which symbol send it ?
Or I must extract it from message alert.
thank you
Thank you very much for this sample.
Is it possible to get real Timestamp of message from Layer1ApiSoundAlertMessage because when you use replay mode you haven't good time.
And how to get Symbol that sent Alert because it's impossible to know which symbol send it ?
Or I must extract it from message alert.
thank you
-
- Posts: 551
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: ALERT LOG
Pls take a look into LastTradeSoundAlert.java at line 43. There's a metadata parameter (Object) which I put the alias (String) into. You can get the metadata from the message. You already know it is a String (I told you ) and now you can cast it to String and extract it (see the updated example attached). But what would happen if I had put nothing in there? Or if I had put object of any other class? You woud not be able to extract info. That means that to get some extra info from an alert message:
1) somebody who constructed the message puts some meaningful metadata in there;
2) you know what class is metadata represented with and you have imported that class so you can cast the metadata to that class and extract it.
The same goes with Timestamp.
1) somebody who constructed the message puts some meaningful metadata in there;
2) you know what class is metadata represented with and you have imported that class so you can cast the metadata to that class and extract it.
The same goes with Timestamp.
- Attachments
-
- SoundAlertFilterSimplified.java
- (2.5 KiB) Downloaded 282 times
-
- Posts: 10
- Joined: Wed Oct 03, 2018 11:03 am
- Has thanked: 1 time
Re: ALERT LOG
hello,
I tried to use metadata but for Stop&Iceberg you have only message sent to alert windows.
I saw in property of Layer1ApiSoundAlertMessage and I don't find any string or variable with Timestamp. You have only core of message no DateTime.
For example, how to read Timestamp from Alert sent by Stop and Iceberg.
Or Perhaps it's hidden in ALERT_ID , so how to decode it ? (alertId=xCTHH7oeQd2m0athd7mOLQ==)
thank you
I tried to use metadata but for Stop&Iceberg you have only message sent to alert windows.
I saw in property of Layer1ApiSoundAlertMessage and I don't find any string or variable with Timestamp. You have only core of message no DateTime.
For example, how to read Timestamp from Alert sent by Stop and Iceberg.
Or Perhaps it's hidden in ALERT_ID , so how to decode it ? (alertId=xCTHH7oeQd2m0athd7mOLQ==)
thank you
-
- Posts: 551
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: ALERT LOG
Hi oceanis,
In general, if an indicator does not feature any extended alert data you can always ask the indicator developer to include such data into alerts. In this very case the indicator is developed by Bookmap. Your message is qualified as a feature request. We will consider adding some extra data into alerts but we cannot tell at the moment if we make it soon.
In general, if an indicator does not feature any extended alert data you can always ask the indicator developer to include such data into alerts. In this very case the indicator is developed by Bookmap. Your message is qualified as a feature request. We will consider adding some extra data into alerts but we cannot tell at the moment if we make it soon.
-
- Posts: 24
- Joined: Wed May 26, 2021 12:13 pm
- Has thanked: 2 times
Re: ALERT LOG
Hi Andrey,
I'm using your SoundAlertFilterSimplified.java class and trying to listen to this message but onUserMessage never catches it:
Any ideas why? It works fine for the LastTradeSoundAlert example but this one for STP reject it doesn't call the onUserMessage. If you want to replicate just try to place a sell STP above best bid and it will reject.
Or do you have any other recommendation to catch the REJECT message from Rithmic?
I'm using your SoundAlertFilterSimplified.java class and trying to listen to this message but onUserMessage never catches it:
Code: Select all
20220501 17:06:26.363(UTC) INFO: [SoundAlertsManager] Obtained: Layer1ApiSoundAlertMessage [textInfo='Order placement rejected.
Reason: Invalid stop price.', showPopup=true, repeatCount=1, repeatDelay=null, alertId='0Kg8tHsiTye68lsZj8sqMA==', source=class velox.bookmap.bp, metadata=velox.bookmap.bJ@5e798667, alias='null', alertDeclarationId='null', priority=0, additionalInfo='Platform: Rithmic', isCancelMessage=false]
20220501 17:06:26.363(UTC) TRADING: onOrderUpdated (upper): class velox.api.layer1.data.OrderInfoUpdate{instrumentAlias=GCM2.COMEX@RITHMIC, orderId=133, isBuy=false, type=STP LMT, clientId=9MzCsChoRJyCuUuI0kSI0w==, doNotIncrease=false, filled=0, filledChanged=true, unfilled=1, unfilledChanged=true, averageFillPrice=NaN, averageFillPriceChanged=true, duration=GTC, durationChanged=true, status=CANCELLED, statusChanged=true, limitPrice=1946.9, limitPriceChanged=true, stopPrice=1947.0, stopPriceChanged=true, stopTriggered=false, stopTriggeredChanged=true, modificationUtcTime=0, modificationTimeChanged=true}
Or do you have any other recommendation to catch the REJECT message from Rithmic?
-
- Posts: 551
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: ALERT LOG
Hi,
the SoundAlertFilterSimplified example checks if the userMessage is an instance of Layer1ApiSoundAlertMessage and, if true, logs it.
Order rejection may not initially be a user message. It may be a system text message. In this case you need to get a provider from the api object and add a listener - a Layer1ApiAdminListener implementation with a customized onSystemTextMessage method.
the SoundAlertFilterSimplified example checks if the userMessage is an instance of Layer1ApiSoundAlertMessage and, if true, logs it.
Order rejection may not initially be a user message. It may be a system text message. In this case you need to get a provider from the api object and add a listener - a Layer1ApiAdminListener implementation with a customized onSystemTextMessage method.