Jump to content
Mike Kerr

Replay Mode Hotkey Scripts with working stops

Recommended Posts

So I have to give credit to @KyleK29 for helping me a few mornings just before the open to get these working. Thank you so much Kyle for helping me along.

At the time of writing this I'm using Das Trader Pro version 5.6.4.11

I'm a dad with 3 little kids. I'm still in paper trading phase and I don't feel like I get enough practice during the opening before I have to get the kids ready for school. So the replay mode is key for me to be able to continue my practice after hours. 

These scripts are a mod on the scripts provided in this post

I am mainly using the % scripts but I also made this work for $40 R entry.

Explanation

Original 20% Long Script (Stop only works during open market)

StopPrice=Price-0.01;DefShare=BP*0.97;Share=DefShare*0.25*Price*0.002;Price=Ask-Price+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

The part that needed to change was at the end where DefShare=400

So we replaced this...

DefShare=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

With this...

DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; SELL=Send; DefShare=10;

And presto! Stop orders now work in replay mode.

Here's the Short version

DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; BUY=Send; DefShare=10;

Here are the scripts  I'm using

 

KEEP IN MIND THESE ONLY WORK IN REPLAY MODE!! DO NOT USE THESE FOR LIVE TRADING!! I ACTUALLY DON'T KNOW WHAT WILL HAPPEN BUT KYLE WARNED ME! 😅

LONG
20%

StopPrice=Price-0.01;DefShare=BP*0.97;Share=DefShare*0.25*Price*0.002;Price=Ask-Price+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; SELL=Send; DefShare=10;

50%

StopPrice=Price-0.01;DefShare=BP*0.97;Share=DefShare*0.25*Price*0.005;Price=Ask-Price+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; SELL=Send; DefShare=10;

100%

StopPrice=Price-0.01;DefShare=BP*0.97;Share=DefShare*0.25*Price*0.001;Price=Ask-Price+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; SELL=Send; DefShare=10;

$40

StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=40/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; SELL=Send; DefShare=10;

 

 

SHORT
20%

StopPrice=Price+0.01;DefShare=BP*0.97;Share=DefShare*0.25*Price*0.002;Price=Price-Bid+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price=bid-0.05;TIF=DAY+;SELL=Send;DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; BUY=Send; DefShare=10;

50%

StopPrice=Price+0.01;DefShare=BP*0.97;Share=DefShare*0.25*Price*0.005;Price=Price-Bid+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price=bid-0.05;TIF=DAY+;SELL=Send;DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; BUY=Send; DefShare=10;

100%

StopPrice=Price+0.01;DefShare=BP*0.97;Share=DefShare*0.25*Price*0.001;Price=Price-Bid+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price=bid-0.05;TIF=DAY+;SELL=Send;DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; BUY=Send; DefShare=10;

$40

StopPrice=Price+0.01;DefShare=BP*0.97;Price=Price-Bid+0.01;SShare=40/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price=Bid-0.05;TIF=DAY+;SELL=Send;DefShare=Share; Route=Stop; StopType=Market; Share=DefShare; TIF=DAY; BUY=Send;

 

I hope this helps someone!
Please let me know if you have any question, tips or suggestions!

Edited by Mike Kerr
Corrected Code blocks for highlighting python
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Of course!
As a Software Engineer myself, I believe strongly in documentation. Even if no one uses it, it’s an extended memory box I can refer to once I’ve forgotten how to repeat the solution. 😅

  • Like 1

Share this post


Link to post
Share on other sites

Nice - this is just what i was looking for, wanted to practice after hours but my stops were'nt working, this will be great. Now ideally would like to open one DAS version during the day use hot key's then in the evening open after hours DAS and use the same hot keys but using the above versions of the scripts. Anyone doing that? Not sure how to accomplish. Or does anyone know a simple way to accomplish this?  

  • Like 1

Share this post


Link to post
Share on other sites

The way I’m doing it is that I have a stream deck where I have programmed my live buttons and my replay buttons. I use a different color set so I don’t accidentally use the replay buttons during normal trading hours. But they are the same orders over the same buttons so I don’t have to learn different muscle memory for replay vs market hours. 
 

I have seen Kyle create different hotkey files and that’s also a way you can manage. Just don’t forget at night to switch back before market open. 

A42ACBEA-ECFE-43BD-8566-246BF78DC1B2.jpeg

8D790CD4-6943-43B0-B593-025AD2D43AB1.jpeg

Share this post


Link to post
Share on other sites

That is super cool, I'm an IT Guy so this is right up my alley. I've searched and found many different hotkey scripts, do you have or know where i can find the latest version(s). I was really looking for one that - If i double click the chart where i want my price, then buy 100, 200, 300... Long and Short... Have you seen anything like that. I was considering a streamdeck that would help, however i travel and would like to become profecient at keyboard combos.. But in the office this would be great, thanks for sharing.

Share this post


Link to post
Share on other sites

My setup still works with double clicking the chart. I double click where I want my stop to be and then click the button on the stream deck. So I have right hand on my mouse and left hand on my stream deck. 
 

There is a pricy travel option. I originally went with the Asus Zendesk Duo. It gives you a touch screen above the keyboard which I put my montage and buttons on. https://www.asus.com/us/Laptops/For-Home/ZenBook/ZenBook-Pro-Duo-UX581/
 

It was a novel idea at the time for travel but the problem I found was that the keys not being tactile I have to look away from my chart to press them. And if I hovered my finger over the location and watched my chart then I would sometimes press too soon because of the sensitivity of the touch screen. And on top of that sometimes the wrong hotkey. So I ended up splurging on the stream desk. It’s about the size of a large mouse so I know I can travel with it. Just need at least a tray table to set it on.

Share this post


Link to post
Share on other sites

Nice great information, oh so what you have isnt too large, that would work. Any hints or clues where i can find the latest DAS hotkey scripts. It seems that Kyle has many or at least when i was going thru the training videos he had an excel sheet with tons of them, I did find a PDF with some of them. Thanks again. 

Share this post


Link to post
Share on other sites

As a note for users who find this thread, DAS now supports TriggerOrders via ReplayMode as of 5.6.4.15 (production release).   So you no longer need the special hotkeys and you can use your normal hotkeys.

 

  • 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

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.