keyboard shortcuts for trading

Add your new features and requests here.
kb_trader
Posts: 6
Joined: Wed Oct 09, 2019 10:49 pm

Re: keyboard shortcuts for trading

Post by kb_trader » Wed Oct 09, 2019 10:56 pm

Done.

Tried using Control + F keys to essentially get around the F10 which is a default main menu shortcut for java apps.
However this isn't ideal... yes it works to prevent the main menu from opening and sends the order but then
BM must be clicked on anywhere with the mouse or else it will no longer respond as BM is no longer in focus or most front.

If someone has found a better way?
If BM can implement something simple, built into the it would be most helpful.

Thanks

 
Attachments
KB SC.PNG
KB SC.PNG (11.66 KiB) Viewed 195 times

mpxtreme
Posts: 28
Joined: Thu Oct 25, 2018 12:20 am
Been thanked: 4 times

Re: keyboard shortcuts for trading

Post by mpxtreme » Sat Oct 12, 2019 2:05 am

AndreyR wrote:
Tue Aug 13, 2019 3:25 pm
Hi IntheZone,
the code I have posted is a sample 'custom user module' created for Bookmap with a Simplified API. Take a look at this package
https://github.com/BookmapAPI/DemoStrategies
There's a brief overview in the Doc folder. You are welcome to ask your questions if something goes wrong.
There are a bunch of simplified demo strategies in that package, take a look at them. they are created with a very simple yet powerful Simplified interface. To make your module work just extend some simple interfaces, launch your strategy to Bookmap and voila you have your own strategy working. All you need is some software development background

Is there a “flatten all” command?

Thanks
mpxtreme
Last edited by mpxtreme on Fri Nov 01, 2019 9:08 pm, edited 2 times in total.

AndreyR
Posts: 157
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 10 times
Been thanked: 37 times

Re: keyboard shortcuts for trading

Post by AndreyR » Sun Oct 13, 2019 7:38 pm

“flatten all” command is in the API
There's no flatten all command in the API. "Flatten" closes open positions and cancels pending orders. So to flatten you have to track your position and pending orders first. Then when you actually "flatten" place a position-sized market order to close it and cancel orders with API.

mpxtreme
Posts: 28
Joined: Thu Oct 25, 2018 12:20 am
Been thanked: 4 times

Re: keyboard shortcuts for trading

Post by mpxtreme » Mon Oct 14, 2019 11:05 pm

Thanks AndreyR!


I am also trying to find a way around the F10 key...seeing the same behavior where BM is no longer the front focused app.

Thanks
mpxtreme

AndreyR
Posts: 157
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 10 times
Been thanked: 37 times

Re: keyboard shortcuts for trading

Post by AndreyR » Fri Nov 01, 2019 2:19 pm

Hi! Here's a workaround that has not been thorouhly exemined. It is not perfect but I can place orders with F10 and not involve menu call.

Code: Select all


        Action action = new AbstractAction()
        {
            @Override
            public void actionPerformed(ActionEvent e){}
        };
        
        Frame[] frames = Frame.getFrames();
        for (Frame frame : frames) {
            Component[] components = frame.getComponents();
            for (Component component : components) {
                if (component instanceof JComponent) {
                    JComponent jcomponent = (JComponent) component;
                    String key = "F10";
                    KeyStroke f10 = KeyStroke.getKeyStroke( key );
                    InputMap map = jcomponent.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
                    map.put(f10, key);
                    jcomponent.getActionMap().put(key, action);
                }
            }
        }

blk
Posts: 5
Joined: Fri Nov 01, 2019 8:59 pm

Re: keyboard shortcuts for trading

Post by blk » Fri Nov 01, 2019 9:05 pm

Hi Andrey,

I'm playing with shortcuts on BM and I'm wondering if there is a way to only enable the shortcuts when the heatmap is on focus? 

As of now, the shortcuts are going to all instruments where the addon is loaded. So my idea is to have the addon loaded on lets say, ES and CL and when I have the the ES heatmap on focus the shortcuts will be enabled and when I switch to CL heatmap the shortcuts will be disable on ES and enable on CL.

Appreciate any ideas you have for this.

Thanks

berenis
Posts: 10
Joined: Sat Oct 26, 2019 1:18 am
Been thanked: 1 time

Re: keyboard shortcuts for trading

Post by berenis » Tue Nov 19, 2019 11:18 am

Much needed, these shortcuts + offset so for example, joing the BID +0.01

AndreyR
Posts: 157
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 10 times
Been thanked: 37 times

Re: keyboard shortcuts for trading

Post by AndreyR » Thu Nov 21, 2019 9:29 am

blk wrote: my idea is to have the addon loaded on lets say, ES and CL and when I have the the ES heatmap on focus the shortcuts will be enabled and when I switch to CL heatmap the shortcuts will be disable on ES and enable on CL
This feature (reading an active symbol) will be available for the next release. I'll make an example and will post it in this topic.

Post Reply