Stop & Iceberg API
-
- Posts: 10
- Joined: Wed Oct 03, 2018 11:03 am
- Has thanked: 1 time
Stop & Iceberg API
hello,
What is Java to get Iceberg and Stop value directly from module or how to use alert in a Strategy ?
Have you Java sample ?
thank you
What is Java to get Iceberg and Stop value directly from module or how to use alert in a Strategy ?
Have you Java sample ?
thank you
-
- Posts: 616
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 27 times
- Been thanked: 87 times
Re: Stop & Iceberg API
Hi oceanis,
currently not supported but you can leave your request in this topic.to get Iceberg and Stop value directly from module
Take a look at this example. An alert is played on every n-th trade.how to use alert in a Strategy ? Have you Java sample ?
Code: Select all
package velox.api.layer1.simplified.demo;
import velox.api.layer1.annotations.Layer1ApiVersion;
import velox.api.layer1.annotations.Layer1ApiVersionValue;
import velox.api.layer1.annotations.Layer1SimpleAttachable;
import velox.api.layer1.annotations.Layer1StrategyName;
import velox.api.layer1.data.InstrumentInfo;
import velox.api.layer1.data.TradeInfo;
import velox.api.layer1.layers.utils.SoundSynthHelper;
import velox.api.layer1.messages.Layer1ApiSoundAlertCancelMessage;
import velox.api.layer1.messages.Layer1ApiSoundAlertCancelMessage.Layer1ApiSoundMessagesFilter;
import velox.api.layer1.messages.Layer1ApiSoundAlertMessage;
import velox.api.layer1.simplified.Api;
import velox.api.layer1.simplified.CustomModule;
import velox.api.layer1.simplified.InitialState;
import velox.api.layer1.simplified.TradeDataListener;
@Layer1SimpleAttachable
@Layer1StrategyName("Sound Alerts")
@Layer1ApiVersion(Layer1ApiVersionValue.VERSION2)
public class LastTradeSoundAlert implements CustomModule, TradeDataListener {
private Api api;
private int tradeCounter;
private String alias;
// an alert will be played for every n-th trade
private int n = 10;
private byte[] alertSound = SoundSynthHelper.synthesize("alert");
private Layer1ApiSoundAlertMessage alertMessage = new Layer1ApiSoundAlertMessage(alertSound, "", 1, null,
(a, s) -> {
}, this.getClass(),
alias);
@Override
public void initialize(String alias, InstrumentInfo info, Api api, InitialState initialState) {
this.api = api;
this.alias = alias;
}
@Override
public void onTrade(double price, int size, TradeInfo tradeInfo) {
tradeCounter++;
// play alert for every n-th trade
if (tradeCounter % n == 0) {
api.sendUserMessage(alertMessage);
}
}
@Override
public void stop() {
// cancel queued alerts for this module if there are any
// so they will not be played when the module is stopped
Layer1ApiSoundMessagesFilter soundMessagesFilter = new Layer1ApiSoundAlertCancelMessage.Layer1ApiSoundMessagesFilter() {
@Override
public boolean shouldCancelMessage(Layer1ApiSoundAlertMessage message) {
if (alias.equals(message.metadata)) {
return true;
}
return false;
}
};
api.sendUserMessage(new Layer1ApiSoundAlertCancelMessage(this.getClass(), soundMessagesFilter));
}
}
-
- Posts: 10
- Joined: Wed Oct 03, 2018 11:03 am
- Has thanked: 1 time
Re: Stop & Iceberg API
Hello,
Thank you for this answer.
It will be more simple to Log all Alert in a file.
Thank you for this answer.
It will be more simple to Log all Alert in a file.
-
- Posts: 616
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 27 times
- Been thanked: 87 times
Re: Stop & Iceberg API
We are excited to announce that Stops & Icebergs is now available as a standalone product, allowing you to purchase it separately from the MBO Bundle. The MBO Bundle remains a cost-effective option if you’re also interested in Market Pulse or Tradermap Pro.
Learn more about the MBO Bundle: https://marketplace.bookmap.com/marketp ... oduct/7028
Learn more about the separate Stops & Icebergs subscription: https://marketplace.bookmap.com/marketp ... 0385058010
Learn more about the MBO Bundle: https://marketplace.bookmap.com/marketp ... oduct/7028
Learn more about the separate Stops & Icebergs subscription: https://marketplace.bookmap.com/marketp ... 0385058010
Re: Stop & Iceberg API
Is there a way to access the values from the SI indicator with an API?
Thanks
Thanks
-
- Posts: 616
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 27 times
- Been thanked: 87 times
Re: Stop & Iceberg API
Hi,
SI-on-chart is able to broadcast its values via API, more info here
https://bookmap.com/knowledgebase/docs/ ... -api-brapi
Do you use Rithmic or BookmapData?
SI-on-chart is able to broadcast its values via API, more info here
https://bookmap.com/knowledgebase/docs/ ... -api-brapi
Do you use Rithmic or BookmapData?
Re: Stop & Iceberg API
Thanks! I'm currently using BookmapData. Are there any differences between the two?
-
- Posts: 616
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 27 times
- Been thanked: 87 times
Re: Stop & Iceberg API
BookmapData provides upto 48 hours of historical data, Rithmic has no historical data.
In the context of API:
1) BookmapData, by default, prevents user code running with realtime data. Please let me know if you need this feature.
2) Python API is unable to work with BookmapData realtime.
In the context of API:
1) BookmapData, by default, prevents user code running with realtime data. Please let me know if you need this feature.
2) Python API is unable to work with BookmapData realtime.