Jump to content

We have moved to Discord. Please click here to join us in the Trading Terminal Discord server.



These forums are read-only.

DavidPaul

Trading Terminal Replay - Hotkeys Plugin

Recommended Posts

DavidPaul

Hi!

I love the Trading Terminal Replay - it's great for practicing strategies.  I use it a lot to practice ORB against historical gappers data.  The big problem I had was that I found it felt fake without hotkeys to get into your position, add to the position, take partials and exit.  But since I am a software engineer that works on web applications I knew there was a solution - so I built a Chrome plugin that adds hotkeys!  Really it's just a bit of javascript that interacts with the buttons on your behalf and tracks your position size, I added the chrome plugin bit so I didn't have to manually load it every time I visited Trading Terminal.  Theoretically it will work with any browser you just need to add the script to the broswer... easier said then done, but happy to help those who don't use Chrome.  Keys can be customized a bit but will require editing the file. 

In the spirit of the community I would like to share it here with some instructions.  

Download the attached TKeys.txt and rename to Tkeys.zip - MODS I AM SORRY I UNDERSTAND YOUR DESIRE TO LIMIT ATTACHEMENT TYPES, IF YOU HAVE CONCERNS LET ME KNOW AND I WILL REVIEW WITH YOU.

 

INSTALLATION

1. Extract the Tkeys Folder to any directory
2. Open Chrome and go click on the 3 dots in the upper right.
3. Select Extensions -> Manage Extensions
4. Click 'Load Unpacked' in the upper left
5. Navigate to and select the Tkeys folder


The plugin will only be active on the replay.tradingterminal.com site if you open the manifest.json file this defines the plugin.  You will see what it does is loads the hotkeys.js file when the site is replay.tradingterminal.com

DEFAULT HOTKEYS (Based on my keyboard layout, and preferences so may not be ideal for you)
Reset Share Size to Default (100) - Scroll Lock
Increase Share Size By 50 - Arrow Up
Decrease Share Size By 50 - Arrow Down
Go Long -  Insert
Go Short - Delete
Partial Long Position (20% by default) - Home
Partial Short Position (20% by default) - End
Sell All - Page Up
Cover All - Page Down
Press 'Play' Button - Arrow Right
Reset To Open - Arrow Left


CUSTOMIZATION
1. Open the TKeys folder and look for the hotkeys.js file (there are only 2 files so this should be easy)
2. Open the hotkeys.js file - this can be done with notepad or any text editor
3. At the top of the file are all the key and variable definitions that can be changed.  I will define the below

When defining the keys you need to put in the correct key code.  The easiest way is go to this site https://www.toptal.com/developers/keycode then you can just press the key you want to use and look at the event.key box.  At this time this plugin doesn't support combo keys (i.e. control + somekey) but could be modified to support this.  

const DEFAULT_SHARE_SIZE = 100    //This is the default share size, when you press the RESET_SHARES_KEY this is the value it will put in
const SHARE_STEP = 50  //How much should shares be increased/decrease when you press the INCREASE_SHARES_KEY / DECREASE_SHARES_KEY
const PARTIAL = 0.20  // how much to partial when you press one of the PARTIAL keys
const LONG_KEY = 'Insert'  // Which key to go long
const SHORT_KEY = 'Delete' // Which key to go short
const LONG_PARTIAL_KEY = 'Home'  // Partial from a long position
const SHORT_PARTIAL_KEY = 'End'  // Partial from a short position
const SELL_ALL_KEY='PageUp'  // Sell all your position
const COVER_ALL_KEY = 'PageDown' // Cover all your position
const RESET_SHARES_KEY = 'ScrollLock'  // Reset shares to the default share size
const INCREASE_SHARES_KEY = 'ArrowUp' // increase shares
const DECREASE_SHARES_KEY = 'ArrowDown' // decrease shares
const PLAY_KEY = 'ArrowRight' // start the replay
const OPEN_KEY = 'ArrowLeft' // return to the open

Please note I a software engineer and not a a quality assurance engineer so there are problems use cases, and issues I have not handled, but if you run into problems let me know and I will be happy to help.  


EDIT - 

- Updated script to not allow using long + short keys at same time (i.e you can only be long or short, need to close one position before opening the other)
- Update when switching symbols resets the current share value to 0

Note - the script will lose your position when switching between symbols so best to practice on one symbol then move to another. 

 

 

 

 

 

 

 

TKeys.txt

Edited by DavidPaul
Update to plugin

Share this post


Link to post
Share on other sites
Paul aka Aurbano

amazing work mate !! try and contact with support or the trading terminal supervisor in the main chat to share your work as they usually do not review the forum often 🙂

Share this post


Link to post
Share on other sites
DavidPaul

Thank you! Good idea I will let them know 

Share this post


Link to post
Share on other sites

[[Template core/front/global/mobileNavigation is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.