Stop & Iceberg API

Custom indicators, trading strategies, data export and recording and more...
oceanis400
Posts: 10
Joined: Wed Oct 03, 2018 11:03 am
Has thanked: 1 time

Stop & Iceberg API

Post by oceanis400 » Wed Jan 06, 2021 9:11 pm

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
 

Andry API support
Posts: 616
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 27 times
Been thanked: 87 times

Re: Stop & Iceberg API

Post by Andry API support » Mon Jan 11, 2021 11:03 am

Hi oceanis,
to get Iceberg and Stop  value directly from module
currently not supported but you can leave your request in this topic.
how to use alert in a Strategy ? Have you Java sample ?
Take a look at this example. An alert is played on every n-th trade.

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));
    }

}






 

oceanis400
Posts: 10
Joined: Wed Oct 03, 2018 11:03 am
Has thanked: 1 time

Re: Stop & Iceberg API

Post by oceanis400 » Tue Jan 12, 2021 6:14 pm

Hello,

Thank you for this answer.

It will be more simple to Log all Alert in a file.

Andry API support
Posts: 616
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 27 times
Been thanked: 87 times

Re: Stop & Iceberg API

Post by Andry API support » Wed Sep 25, 2024 2:14 pm

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

jayenoh
Posts: 2
Joined: Mon Aug 08, 2022 11:11 am

Re: Stop & Iceberg API

Post by jayenoh » Sat Nov 16, 2024 6:27 pm

Is there a way to access the values from the SI indicator with an API?

Thanks

Andry API support
Posts: 616
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 27 times
Been thanked: 87 times

Re: Stop & Iceberg API

Post by Andry API support » Mon Nov 18, 2024 8:32 am

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?

jayenoh
Posts: 2
Joined: Mon Aug 08, 2022 11:11 am

Re: Stop & Iceberg API

Post by jayenoh » Mon Nov 25, 2024 2:12 am

Thanks! I'm currently using BookmapData.  Are there any differences between the two?

Andry API support
Posts: 616
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 27 times
Been thanked: 87 times

Re: Stop & Iceberg API

Post by Andry API support » Tue Nov 26, 2024 7:01 am

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.

Post Reply