Jump to content

Recommended Posts

Can anyone help me out with a hotkey theory of mine? This may seem silly but create a new hotkey file and put the following in it:

Crtl+Shift+2:Buy 200 Shares at Market :ROUTE=ARCAM;ACCOUNT=TRIB8359;Share=200;TIF=DAY+;BUY=Send
Alt+M:Sell Full Position at Market :ROUTE=ARCAM;ACCOUNT=TRIB8359;Share=Pos;TIF=DAY+;SELL=Send
Shift+1:Buy 100 Shares at Market :ROUTE=ARCAM;ACCOUNT=TRIB8359;Share=100;TIF=DAY+;BUY=Send
 

Just change out TRIB8359 with your sim account number, make sure to use your sim account so as not to place actual orders. 

Now pick a symbol on your montage. On my computer, when I press Shift+1 I buy 100 shares at market. 

When I press Crtl+Shift+2, DAS should buy 200 shares at market but nothing happens. 

Next, go to the hotkey editor within DAS, select the Buy 200 shares at market hotkey, click reset key, and then in that field put Crtl+Shift+2

Now, try Crtl+Shift+2 - this time it works, and gets you 200 shares at market!

Here's the kicker - so when I open the hotkey file in notepad the line is still:

Ctrl+Shift+2:Buy 200 Shares at Market :ROUTE=ARCAM;ACCOUNT=TRIB8359;Share=200;TIF=DAY+;BUY=Send

That's identical to the line earlier. But when I typed it in, it didn't work. But when DAS created the line, it works, but the line is exactly the same. 

I only have this problem using the Crtl key in my hotkeys. Shift and Alt work just fine, but any time I want to use Crtl I cannot just type it in withing Notepad - DAS must put it in the hotkey file, or it doesn't work. So weird!

Can anyone replicate this problem? I'm not sure if it's a problem with DAS or a problem with my computer - I'm actually running Windows 10 as boot camp on a Mac, so maybe it's an oddity related to that. But if you get the same behavior on your PC that's not Windows boot camp running on a Mac, then it would be a DAS issue... Thanks!

Edited by sawtooth500

Share this post


Link to post
Share on other sites

It is most probably that another application is utilizing that keystroke.

For me when I hit Ctrl+Shift+2, Dell Display Manager turns off my right monitor 😛

So I quit the Display Manager, made a new hotkey using Ctrl+Shift+2 and set the script to: ROUTE=ARCAM;ACCOUNT=xxxxxxxx;Share=200;TIF=DAY+;BUY=Send

And it worked perfectly fine.

Share this post


Link to post
Share on other sites
21 minutes ago, Justin said:

It is most probably that another application is utilizing that keystroke.

For me when I hit Ctrl+Shift+2, Dell Display Manager turns off my right monitor 😛

So I quit the Display Manager, made a new hotkey using Ctrl+Shift+2 and set the script to: ROUTE=ARCAM;ACCOUNT=xxxxxxxx;Share=200;TIF=DAY+;BUY=Send

And it worked perfectly fine.

I don't think it's another application using it because the Crtl works for hotkeys if the DAS hotkey editor inserts it into the hotkey file but not if I type it into the hotkey file in notepad. If it was another application then I'd think that it shouldn't work in either case...

Share this post


Link to post
Share on other sites

Have you tried using a proper text editor (not Notepad)? It can really screw with syntax and formatting.

Try using Atom. It's free and open source. Link

Share this post


Link to post
Share on other sites
49 minutes ago, Justin said:

Have you tried using a proper text editor (not Notepad)? It can really screw with syntax and formatting.

Try using Atom. It's free and open source. Link

Good idea, I tried Atom, but the exact same behavior persists as with notepad. I still suspect it's either DAS or something weird with my computer because I'm using bootcamp on a Mac. 

Share this post


Link to post
Share on other sites

Just to give some food for thought on this, but the Hotkey file is compromised of a defined structure.

So the structure is like this:

{*keycombo-as-string*}:{Title-as-string (max length: 99}:{script-as-string, max 51 bytes} \n (new lines are not rendered in notepad)

If you go over the 51 byte limit, it adds a value to signify the total length of the command (including spaces).

So this:

ROUTE=ARCAM;ACCOUNT=TRIB8359;Share=200;TIF=DAY+;BUY=Send

..hotkey script is 57bytes, and what the program sees is this:

ROUTE=ARCAM;ACCOUNT=TRIB8359;Share=200;TIF=DAY+;BU

 

To do a multi-line (longer) command up to 999 bytes, you have to add the length in bytes. Format is this:

{*keycombo-as-string*}:{Title-as-string (max length: 99}:~ {length of script}:{script-as-string, first 51 bytes} \n (new lines are not rendered in notepad)

{51 byte chunk of script}\n

{51 byte chunk of script}\n

.. repeat until the end of the Hotkey Script.

 

Using yours as an example, the correct syntax is this:

 

Ctrl+Shift+2:Buy 200 Shares at Market:~ 57:ROUTE=ARCAM;ACCOUNT=TRIB8359;Share=200;TIF=DAY+;BU
Y=Send

What is most likely happening and why it changes when you tweak it in the DAS editor versus a text editor is that DAS is correcting for the hidden characters (new line, tab, etc). A slight issue in syntax can throw it off.

Additionally, if you're editing while DAS is running, you have to open the Hotkey editor to load the changes into the memory space. They're only loaded on program initialization otherwise.

If you're trying to create a dynamic hotkey; one where another program changes values; you have to do so by editing the values in memory directly. It's 100% doable, but takes a lot of knowledge. I had a working script that would automatically trail a Stop order to a moving average by a set offset as a prototype. It was just too cumbersome for distribution.

Edited by KyleK29
  • Like 1

---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites
1 hour ago, Justin said:

Wow. How you even know this stuff is amazing Kyle...

He has the right tools to interrogate his computer......sign of PRO.....ability to step / pause any program is very powerful.

Remember wht he did b4...........lol

Share this post


Link to post
Share on other sites
On 6/13/2020 at 6:56 PM, KyleK29 said:

Just to give some food for thought on this, but the Hotkey file is compromised of a defined structure.

So the structure is like this:

{*keycombo-as-string*}:{Title-as-string (max length: 99}:{script-as-string, max 51 bytes} \n (new lines are not rendered in notepad)

If you go over the 51 byte limit, it adds a value to signify the total length of the command (including spaces).

So this:

ROUTE=ARCAM;ACCOUNT=TRIB8359;Share=200;TIF=DAY+;BUY=Send

..hotkey script is 57bytes, and what the program sees is this:

ROUTE=ARCAM;ACCOUNT=TRIB8359;Share=200;TIF=DAY+;BU

 

To do a multi-line (longer) command up to 999 bytes, you have to add the length in bytes. Format is this:

{*keycombo-as-string*}:{Title-as-string (max length: 99}:~ {length of script}:{script-as-string, first 51 bytes} \n (new lines are not rendered in notepad)

{51 byte chunk of script}\n

{51 byte chunk of script}\n

.. repeat until the end of the Hotkey Script.

I've recently written an external GUI editor for the DAS hotkeys file and from my tests with v5.5.0.3 I found a small difference to your description so I don't know if anything has changed since you looked at it, although I doubt it will affect loading:

The script as string element can be up to 100 characters on the first line.  At 101 or greater characters I find it wraps using the method you describe although there is a slight twist that a there is some escaping of certain characters in the script part.  These are unlikely to be present in a script but if there they are escaped with the character followed by a text representation of the character code for it.  Such encoding characters increase the length of the string as stored but are NOT included in the overall script length as stored in the earlier field.

The reason I wrote an external editor is I've based many of my hotkeys on your excellent spreadsheet but wanted a way to easily transfer those to DAS in one go.  I have my own spreadsheet that refers to my scripts or yours with additional columns for the title and shortcut key combination.  These are combined in another column to what I call a plain DAS format, basically without any escaping or line wrapping.

I can then copy and paste all of them in one go into my DAS hotkeys editor application which allows editing in a grid view or a text view with this plain text format.  The application automatically converts this to the correct DAS format when saving or switching between its tabs (it has one for a grid view, one for plain file and one with a readonly view of the file as it will be saved).

I did wonder if this application was worth the development time as opposed to some script in the spreadsheet, but in a few days of experimenting/debugging my trading hotkeys its proved very helpful as it allows sorting, filtering (useful for merging) which a spreadsheet couldn't.  

I am just finishing another utility to configure my Stream Deck keys directly, so from one spreadsheet I can update everything in seconds without any human error. 

I was wondering how I could share any of this, but given the desktop app (c#) uses some of my own commercial code I would have to make some minor adjustments if providing source as well. However I expect a web version would be the best approach for sharing, but my focus was just a quick and dirty utility initially even though it grew a bit beyond that.

Share this post


Link to post
Share on other sites

 

On 6/13/2020 at 1:56 PM, Justin said:

Wow. How you even know this stuff is amazing Kyle...

On 6/13/2020 at 3:15 PM, Alastair said:

He has the right tools to interrogate his computer......sign of PRO.....ability to step / pause any program is very powerful.

Remember wht he did b4...........lol

For this, I didn't use any tools. I just looked at my .htk file and noticed the structured pattern. Is that a sign of being a major nerd? I think it might be ....

 

1 hour ago, smp said:

I've recently written an external GUI editor for the DAS hotkeys file and from my tests with v5.5.0.3 I found a small difference to your description so I don't know if anything has changed since you looked at it, although I doubt it will affect loading:

The script as string element can be up to 100 characters on the first line.  At 101 or greater characters I find it wraps using the method you describe although there is a slight twist that a there is some escaping of certain characters in the script part.  These are unlikely to be present in a script but if there they are escaped with the character followed by a text representation of the character code for it.  Such encoding characters increase the length of the string as stored but are NOT included in the overall script length as stored in the earlier field.

The reason I wrote an external editor is I've based many of my hotkeys on your excellent spreadsheet but wanted a way to easily transfer those to DAS in one go.  I have my own spreadsheet that refers to my scripts or yours with additional columns for the title and shortcut key combination.  These are combined in another column to what I call a plain DAS format, basically without any escaping or line wrapping.

I can then copy and paste all of them in one go into my DAS hotkeys editor application which allows editing in a grid view or a text view with this plain text format.  The application automatically converts this to the correct DAS format when saving or switching between its tabs (it has one for a grid view, one for plain file and one with a readonly view of the file as it will be saved).

I did wonder if this application was worth the development time as opposed to some script in the spreadsheet, but in a few days of experimenting/debugging my trading hotkeys its proved very helpful as it allows sorting, filtering (useful for merging) which a spreadsheet couldn't.  

I am just finishing another utility to configure my Stream Deck keys directly, so from one spreadsheet I can update everything in seconds without any human error. 

I was wondering how I could share any of this, but given the desktop app (c#) uses some of my own commercial code I would have to make some minor adjustments if providing source as well. However I expect a web version would be the best approach for sharing, but my focus was just a quick and dirty utility initially even though it grew a bit beyond that.

I should note, I'm using the beta 5.5.0.5 (and now 5.5.1.0) so the structure may have changed a little .. I believe they made a change in 5.5.0.4 to increase the available character limit in the scripts. But I will say that doing any type of script creation is never a waste of time as you learn *a lot* by doing it. So the time may not have been worth the actual result, but it was worth the knowledge gained. Just my opinion.

The new version of the Hotkey configurator will do the install for you. It uses a special uniqueID slug in the hotkey (that DAS ignores) which goes to a database and pulls the hotkey command, so you can then just login to the Hotkey Configuration tool and make your updates, upload your .htk file, and get a returned configured hotkey file. It will streamline the process and remove the Excel requirement because it's a web app. It also allows me to add better knowledge base / help and form entry for users.

 

After I finish that, I plan to release my DAS Utilities package for Python which will have Config / Hotkey and Log parsers, plus a custom TTS alert example (so you can script alerts as you see fit). It'll be open-source and should make any creators life a lot easier as it gives a framework for this stuff. 

Edited by KyleK29

---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites
2 hours ago, KyleK29 said:

I should note, I'm using the beta 5.5.0.5 (and now 5.5.1.0) so the structure may have changed a little

The increase to 1000 characters is shown in release notes as v5.5.0.0, or are you referring to something else?

The encoded characters issue (easy to test given the DAS use of non Unicode files) appears in recent versions I checked and the wrapping was the same as well.  DAS seems to be VERY old school in some areas of its design but that's not uncommon for niche area products (I work in the field of performance and scalability of enterprise applications and nothing surprises me anymore)

Share this post


Link to post
Share on other sites
2 hours ago, smp said:

The increase to 1000 characters is shown in release notes as v5.5.0.0, or are you referring to something else?

The encoded characters issue (easy to test given the DAS use of non Unicode files) appears in recent versions I checked and the wrapping was the same as well.  DAS seems to be VERY old school in some areas of its design but that's not uncommon for niche area products (I work in the field of performance and scalability of enterprise applications and nothing surprises me anymore)

I think I remember seeing one other fix outside of the 1000 character limit. 

 

I wouldn't mind seeing your .htk file that has the 100 character length for the script portion. Here's one with various scenarios and how it's formatted for me:

:Escape_Characters_Basic_Latin_Unicode:~ 187:! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 :
 ; < = > ? @ A B C D E F G H I J K L M N O P Q R S 
T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m
 n o p q r s t u v w x y z { | } ~7E
:Maximum_Length_Test_Extra:~ 998:TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESSSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESSSSSSSSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSST
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFTESTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TTEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFTESTTTTTTTTTTTTTTTTTTTTTTT
:Line1Test1_Well_Well_Well Copy:Route=Limit;Share=Pos*0.25;Price=StopPrice-AvgCost;Price=Price*1.25;
:ItemD:DefShare=DefShare+0
:ItemC:DefShare=DefShare+0
:Item:~7E DefShare=DefShare+0 ~7E
Alt+Ctrl+F10:ACF10_Long_Test_Maybe:~ 501:#Hashtag_Again; CXL BELOWAVGCOST;StopPrice = Price;
Share=Price*100;Price=AvgCost;SShare=Price*100;Shar
e=Share-SShare;Price=Share;Price=Share/100;Share=Po
s * Price;Price=Ask-StopPrice;SShare=Share / Price;
DefShare=BP*0.97;Share=DefShare-SShare;DefShare=Def
Share+SShare;SShare=Share;SShare=DefShare-SShare;Sh
are=0.5*SShare; Share=Share*1; Price=Ask+0.05;TogSS
hare;TIF=DAY+;ROUTE=SMRTL;BUY=SEND;DefShare=10; Tri
ggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:
SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;
Ctrl+B:SaveTest:SaveLayout
Ctrl+E:MAXIMUM_SHARED_LINKED_TITLE_IS_HERE_TO_STAY_AND_CAN_BE_CONSIDERED_GREAT_GLORIOUS_ADVENTURE_OF_MEN_#:Prefs="Testing how I can make this more appealing"
Ctrl+K:Hashtag Test With #Ae5123kls:WPos X Y
Ctrl+R:SampleG WIth Spaces:#HASHTAG; Testing_this; Price=111;
Ctrl+Shift+E:SampleB:~ 237:Route=Limit;Share=Pos*0.25;Price=StopPrice-AvgCost;
Route=Limit;Share=Pos*0.25;Price=StopPrice-AvgCost;
Price=Price*1.25;Price=AvgCost-Price;Price=Round2;T
IF=DAY+;BUY=Send;Price=Price*1.25;Price=AvgCost-Pri
ce;Price=Round2;TIF=DAY+;BUY=Send
Ctrl+Shift+F:SampleA:~ 118:Route=Limit;Share=Pos*0.25;Price=StopPrice-AvgCost;
Price=Price*1.25;Price=AvgCost-Price;Price=Round2;T
IF=DAY+;BUY=Send
Ctrl+Shift+M:ItemB:DefShare=DefShare+0
TAB:Line1Test1_Well_Well_Well:Route=Limit;Share=Pos*0.25;Price=StopPrice-AvgCost;Price=Price*1.25;
Alt+Ctrl+B:Maximum_Length_Test:~ 962:TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESSSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESSSSSSSSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSST
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFTESTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
SSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TTEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF _1_ _2_ _3__
Alt+Ctrl+D:SampleBBB2:~ 103:Character Counter is a 100% free online character c
ount calculator that's simple to use. imple to use.
;
Alt+Ctrl+Shift+F2:MAXIMUM TITLE IS HERE TO STAY AND I WILL NOT BE OVERSOLD ON HOW LONG THIS 1234 MAYBE A LITTLE MORE :DefShare=0; DefShare=0; DefShare=0; DefShare=0; DefShare=0; DefShare=0; DefShare=0; DefShare=0;

 

Tilde (~) is the only character I can see different, as it shows as ~7E (0x7e is the hex code for that, so it makes sense) .. have you found any other?

*EDIT* I see the 100 char now single line that you're talking about now. I guess I never tried anything between 51 and 100. 

Edited by KyleK29

---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites
13 hours ago, KyleK29 said:

Tilde (~) is the only character I can see different, as it shows as ~7E (0x7e is the hex code for that, so it makes sense) .. have you found any other?

I've just retested as I originally found two, but from a quick retest only the tilde is still being escaped.   

Update: Reviewing my test files from version control some had a bad format else where which by chance made it look like two were escaped.  So for now yes I see just tilde being handled this way. 

13 hours ago, KyleK29 said:

*EDIT* I see the 100 char now single line that you're talking about now. I guess I never tried anything between 51 and 100. 

Okay that's good we see the same.

Do you get any additional info from DAS details other than what is on their site?    I've also reported a few issues/improvements with simple fixes and not even received a reply, but as I am busy setting up my approach/tools (moving from trading UK markets) I've not pursued this yet.

Share this post


Link to post
Share on other sites
5 hours ago, smp said:

I've just retested as I originally found two, but from a quick retest only the tilde is still being escaped.   

Update: Reviewing my test files from version control some had a bad format else where which by chance made it look like two were escaped.  So for now yes I see just tilde being handled this way. 

Okay that's good we see the same.

Do you get any additional info from DAS details other than what is on their site?    I've also reported a few issues/improvements with simple fixes and not even received a reply, but as I am busy setting up my approach/tools (moving from trading UK markets) I've not pursued this yet.

 

No, not from DAS directly, but I've never asked them specifically about this stuff. If you submit bugs, be sure to use the bugs[at]dastrader.com and not the support[at]dastrader.com ... I have noticed they won't reply to a bug report unless they need more additional information, so if you submit a good bug report they tend not to reply. I've had 3 bugs fixed in the last two weeks, so they do tend to move quickly on the beta side.

 

I use a simplified report template:
 

BUG TITLE
OS:
DAS Version: (version # and build datetime from Help > About)

Description of Issue:

User Expected Outcome:

Attachments:

 

 

 


---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

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.