keyboard shortcuts for trading
-
- Posts: 39
- Joined: Sat Oct 27, 2018 4:05 pm
- Location: germany
- Has thanked: 12 times
- Been thanked: 41 times
keyboard shortcuts for trading
is it possible to define custom keyboard shortcuts for trading commands like
buy/sell limit/market
move stop +/- 1tick
move target +/-1tick
The reason is, I use a trading keyboard for trading via SierraChart and it's faster then using the mouse but it works not with Bookmap generated orders, would be great to use it with Bookmap also
thanks
buy/sell limit/market
move stop +/- 1tick
move target +/-1tick
The reason is, I use a trading keyboard for trading via SierraChart and it's faster then using the mouse but it works not with Bookmap generated orders, would be great to use it with Bookmap also
thanks
Re: keyboard shortcuts for trading
Totally agree, keyboard shortcuts are way more in control rather pinpointing mouse generated order.
Most of the trade apps offer kb shortcuts:
LMT B/S
MKT B/S
Increase/Decrease LMT orders & STP orders
Preset Bracket orders
Close/Flaten/Reverse
Most of the trade apps offer kb shortcuts:
LMT B/S
MKT B/S
Increase/Decrease LMT orders & STP orders
Preset Bracket orders
Close/Flaten/Reverse
-
- Posts: 551
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: keyboard shortcuts for trading
Hi all,
you may want to implement these features yourself.
Use Simplified interface, create a KeyEventDispatcher object and assign keys to desired actions.
Here's an example:
you may want to implement these features yourself.
Use Simplified interface, create a KeyEventDispatcher object and assign keys to desired actions.
Here's an example:
Code: Select all
package com.bookmap.api.simple.simplified;
import java.awt.KeyEventDispatcher;
import java.awt.KeyboardFocusManager;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;
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.annotations.Layer1TradingStrategy;
import velox.api.layer1.common.Log;
import velox.api.layer1.data.ExecutionInfo;
import velox.api.layer1.data.InstrumentInfo;
import velox.api.layer1.data.OrderInfoUpdate;
import velox.api.layer1.simplified.Api;
import velox.api.layer1.simplified.CustomModule;
import velox.api.layer1.simplified.OrdersListener;
import velox.api.layer1.simplified.InitialState;
import velox.api.layer1.data.OrderSendParameters;
import velox.api.layer1.data.SimpleOrderSendParametersBuilder;
@Layer1SimpleAttachable
@Layer1StrategyName("Send Order By Key")
@Layer1ApiVersion(Layer1ApiVersionValue.VERSION1)
@Layer1TradingStrategy
public class SendOrderByKey implements CustomModule, OrdersListener {
Api api;
private String alias;
private KeyEventDispatcher customDispatcher;
List<OrderInfoUpdate> list = new ArrayList<>();
String orderAliasTarget;
String orderAliasStop;
int updateCount;
@Override
public void initialize(String alias, InstrumentInfo info, Api api, InitialState initialState) {
this.alias = alias;
this.api = api;
listenForKey();
}
@Override
public void stop() {
KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(customDispatcher);
}
private void sendMarketOrber (boolean isBuy ) {
if (isBuy) {
SimpleOrderSendParametersBuilder shortOrderSendParameters = new SimpleOrderSendParametersBuilder (alias, false, 1);
shortOrderSendParameters.setSize(10);
shortOrderSendParameters.setBuy(isBuy);
OrderSendParameters shortOrder = shortOrderSendParameters.build();
api.sendOrder(shortOrder);
} else {
SimpleOrderSendParametersBuilder OrderSendParameters = new SimpleOrderSendParametersBuilder (alias, false, 1);
OrderSendParameters.setLimitPrice(6300);
OrderSendParameters.setSize(10);
OrderSendParameters.setBuy(isBuy);
OrderSendParameters.setTakeProfitOffset(5);
OrderSendParameters.setStopLossOffset(6);
OrderSendParameters.setStopLossClientId(isBuy?"longStop":"shortStop");
OrderSendParameters.setTakeProfitClientId(isBuy?"longTarget":"shortTarget");
OrderSendParameters orderParam = OrderSendParameters.build();
orderAliasStop = OrderSendParameters.getStopLossClientId();
orderAliasTarget= OrderSendParameters.getTakeProfitClientId();
api.sendOrder(orderParam);
}
}
private void listenForKey() {
customDispatcher = new KeyEventDispatcher() {
@Override
public boolean dispatchKeyEvent(KeyEvent e) {
switch (e.getID()) {
case KeyEvent.KEY_PRESSED:
if (e.getKeyChar() == 'b') {
sendMarketOrber(true);
}
if (e.getKeyChar() == 's') {
sendMarketOrber(false);
}
break;
case KeyEvent.KEY_RELEASED:
break;
case KeyEvent.KEY_TYPED:
break;
}
return false;
}
};
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(customDispatcher);
}
@Override
public void onOrderUpdated(OrderInfoUpdate orderInfoUpdate) {
list.add(orderInfoUpdate);
Log.info("UPDATE " + updateCount++);
}
@Override
public void onOrderExecuted(ExecutionInfo executionInfo) {
// TODO Auto-generated method stub
}
}
Re: keyboard shortcuts for trading
ANDREW --
Thanks for the code -- it looks awesome.
I also need these keyboard shortcuts.
how exaclty do we add this code / make the API? Is there a video we can see to do it? Thanks a million!
Thanks for the code -- it looks awesome.
I also need these keyboard shortcuts.
how exaclty do we add this code / make the API? Is there a video we can see to do it? Thanks a million!
-
- Posts: 551
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: keyboard shortcuts for trading
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.
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.
Re: keyboard shortcuts for trading
The issue with adding our own user custom features, is that they need to be re-imported on updates or re-installs.
This feature is standard in the majority of trade execution platforms.
At least the basics.
Join Bid or Buy Limit
Buy Ask
Join Offer or Sell Limit
Sell Bid
Buy Market
Sell Market
Cancel All
Cancel All + Liquidate
Thanks
This feature is standard in the majority of trade execution platforms.
At least the basics.
Join Bid or Buy Limit
Buy Ask
Join Offer or Sell Limit
Sell Bid
Buy Market
Sell Market
Cancel All
Cancel All + Liquidate
Thanks
Last edited by mpxtreme on Mon Sep 02, 2019 4:03 am, edited 1 time in total.
Re: keyboard shortcuts for trading
mpxtreme wrote: ↑Sat Aug 31, 2019 5:33 amThe issue with adding our own user custom features, is that they need to be re-imported on updates or re-installs.
This feature is standard in the majority of trade execution platforms.
At least the basics.
Join Bid
Buy Offer
Join Offer
Hit Bid
Buy Market
Sell Market
Cancel All
Cancel All + Liquidate
Thanks
Yes -- 100% we need to be able to set Instant FLATTEN of Trade. Definitely 100% very very important.
I also need >>>
Move all stops to mouse pointer price or mouse pointer click price
Move all LIMIT ORDERS / Take Profits to Mouse Pointer click price
REVERSE POSITION also?
Re: keyboard shortcuts for trading
AndreyR wrote: ↑Tue Aug 13, 2019 3:25 pmHi 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.
Andrew -- Github pdf said we need Eclipse in 32bit? is that true? I could only see 64bit Eclipse download there.
Thanks
-
- Posts: 551
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 86 times
Re: keyboard shortcuts for trading
Oops no, thx for your comment. Use Eclipse x64 and Java 8 x64. I will fix the guide today.