Page 1 of 1

ALERT LOG

Posted: Tue Nov 17, 2020 2:24 pm
by oceanis400
hello,

Is it possible to log all ALERT in a file generated by indicators using API ?

thank you

Re: ALERT LOG

Posted: Wed Nov 18, 2020 1:56 pm
by Andry API support
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.

Re: ALERT LOG

Posted: Mon Jan 25, 2021 1:42 pm
by oceanis400
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
 

Re: ALERT LOG

Posted: Tue Jan 26, 2021 8:33 am
by Andry API support
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.

Re: ALERT LOG

Posted: Tue Jan 26, 2021 1:36 pm
by oceanis400
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

Re: ALERT LOG

Posted: Wed Jan 27, 2021 10:22 am
by Andry API support
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.

Re: ALERT LOG

Posted: Mon Feb 01, 2021 7:51 pm
by oceanis400
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

Re: ALERT LOG

Posted: Tue Feb 02, 2021 1:42 pm
by Andry API support
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.

Re: ALERT LOG

Posted: Sun May 01, 2022 5:13 pm
by fenepet965
Hi Andrey,

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}
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?
 

Re: ALERT LOG

Posted: Mon May 16, 2022 10:30 am
by Andry API support
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.