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.

cjsimon07

Help with hotkeys please

Recommended Posts

cjsimon07

I'm using DAS with TD and I'm having a hard time figuring out my hot keys. I figured I'd try the forum before I bother Kyle with another hotkey email...

1. I'm trying to use Thor's fixed risk keys from the room drive. I'm using this script: 

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

But it's not automatically putting in a stop. Double click the chart where I want my stop. I click the hot button and it buys enough shares for $20 risk, but no hard stop order is sent. Then I have to double click the chart at the same price level and click the stop at click button. This works fine, but it's distracting me from the price action while I hurry to get my stop in. Also, my last trade yesterday was on TSLA. I tried using a mental stop. I had my finger on the hotkey on my keyboard (I set "Sell all" as F1 on my keyboard). When it hit my stop price I hit the button and nothing happened. By the time I clicked the sell all hot button on my montage I lost 3r. I definitely need to use hard stops (especially with TSLA) and would really like the order to be sent when I click the buy button. 

1b. I had the issue of my hot keys not always working in demo mode, but it was rare and this was the first time it happened live. My buttons always seem to work. Anyone else experience this? 

1c. The free roll hot buttons don't work for me in demo mode (haven't tried live). I assume it's the same issue with the stop I'm having with the above script. Is there a way to make this work with TD?

CXL ALLSYMB;StopPrice = Price;Share=Price*100;Price=AvgCost;SShare=Price*100;Share=Share-SShare;Price=Share;Price=Share/100;Share=Pos * Price;Price=Ask-StopPrice;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare;Price=Ask+0.05;TogSShare;TIF=DAY+;ROUTE=SMRTL;BUY=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

 

2. For partialing I use a script like this:

CXL ALLSYMB;ROUTE=SMRTL;Price=Bid-0.02;Share=Pos*.1;TIF=DAY+;SELL=Send;ROUTE=SMRTM;
 

This works great, but I'm wondering if there's a way to use this as a click to trade stop or limit order. For example, I want to take 10% off at $50, but the price blows right past $50 and keeps going. I want to double click $50 and set a 10% stop order at $50, so if the price retraces I get my partial on the way down and if it keeps going that order gets canceled when I put in my next partial.  I've been thinking about Thor's 3:1, 33% partial strategy. I could set a stop order at 3:1 and if the price keeps going maybe I can get 4R or better without risking my initial 3:1. 

 

Share this post


Link to post
Share on other sites
Tom C

I also was using DAS with TD when I went live at the beginning of this year . Everything worked fine paper trade but live was a very bad experience.  I don't have an answer for you but from the reading I have done I think  the ;ROUTE=SMRTL of the code is for a limit order  and the SMRTL is for Interactive brokers.    I trade at the open and going live had issues with fills and the hotkeys/buttons( using the same coding that you are using. I am in the processes of switching from TD to IB. I am guessing that there is a reason all the moderators use IB and CMEG. Also the number of stocks that you can short with TD is not very good.  3 of the 4 days I was live I had issues luckily I didn't lose any money.   I am too new to being live to have to worry about fill and technical issues, I will pay the commissions , From what I have read the commissions are not that big of deal.

Share this post


Link to post
Share on other sites
mego_bbt

I am not sure if there is any other issues with the syntax of the hotkeys you wanna use but for sure the ROUTE is one of the issues, I can specify. By looking online, I found that TD used INET Route for NASDAQ. Please see the link below for more information or google TD Ameritrade Stoke Execution Routing Code

https://www.tdameritrade.com/retail-en_us/resources/pdf/TDA196.pdf

Hope this helps.

Share this post


Link to post
Share on other sites
cjsimon07

Thanks for the replies. I also read that SMRT orders wouldn't work with TD, but I'm not sure that's accurate. 

My understanding is that Smart Order Routers (SOR) use algorithms to search multiple market makers to provide that fastest fill at the best price. IB allows DAS direct access trading which sends orders directly from DAS to the marker maker, while TD only allows direct routing which allows you to route your order directly to a marker maker through your broker (TD). However, I think each broker uses their own SOR so maybe SMRT applies only to IB's  SOR?

The partial scripts work fine with TD and they use ROUTE=SMRTL and ROUTE=SMRTM.

 

DAS gives this as an example of fixed risk on their site:

 ROUTE=STOP;StopType=Market;Share=Pos;StopPrice=500/share;StopPrice=AvgCost-StopPrice;StopPrice=Round2;TIF=DAY+;SELL=Send

I think that just puts in a stop for $500 risk ($500 loss) on an existing position. I'm trying to figure out if I can combine that script with parts of Thor's script to make a hot button that will both buy the correct amount of shares for my set risk (say $20) and enter a stop loss order at the price I clicked on the chart. I'm learning about scripting hotkeys, but I'm still struggling with some of the basics of putting them together. Does anyone have a good resource for learning about what each piece of the script does and how to put them together? 

Share this post


Link to post
Share on other sites
Abiel
On 1/9/2021 at 9:17 AM, cjsimon07 said:

1. I'm trying to use Thor's fixed risk keys from the room drive. I'm using this script: 

This is what I am using for Break even stop 

CXL ALLSYMB;Route=Stop;Price=AvgCost;StopType=MARKET;STOPPRICE=AvgCost;StopPrice=Round2;Share=Pos;TIF=DAY+;Send=Reverse

 

Share this post


Link to post
Share on other sites
cjsimon07
6 hours ago, peterB said:

 

I've read that thread a couple times (so much info), but I just re-read it and I think I may have found the issue here: 

TriggerOrder for automatic STOP placement not being sent (no stop order placed).

  • Reason: Montage is not set to a style that doesn't allow TriggerOrder input. Styles not compatible are: Default [DAS's, if you changed it], Basic, OCO, Option, Full
  • Fix: Use a style that is compatible, they are: Stop Order, Detail, Trigger  -- I recommended using the "Stop Order" montage style. To change this, right click the montage area around where you'd enter a price and select Style --> Your Choice.

 

I'll try that tomorrow and hopefully that will fix it. Thanks!

 

1 hour ago, Abiel said:

This is what I am using for Break even stop 


CXL ALLSYMB;Route=Stop;Price=AvgCost;StopType=MARKET;STOPPRICE=AvgCost;StopPrice=Round2;Share=Pos;TIF=DAY+;Send=Reverse

 

I also use this one after I take my first partial. This one works great. Really the only issues I have are the stop not being sent with my fixed risk hot button entries and for whatever reason the hot keys don't always work. Since I had the issue with my hot key not working when I used a mental stop I really want to make sure the hard stop order is placed, so I don't risk losing more than 1r. Hopefully the above fix will do the trick. 

Share this post


Link to post
Share on other sites
Bryan W

@cjsimon07As stated above, SMRT is an IB specific route. SMRTM is a market order, SMRTL is a limit, but unless you have IB, your DAS won't recognize it, and won't adjust the montage properly when you execute a script. You must use whatever is listed in the drop down menu in your montage for route. The first step you'll need to make, is look in the drop down; if it says "LIMIT", replace SMRTL in all your scripts with LIMIT, and anywhere it says SMRTM replace with MARKET, or however it appears in your drop down. The next step for displaying a stop, is to make sure your montage is set to "stop order" style. Right click in lower section of montage, style, stop order. There can be some other setup issues as well, but these will be the first steps. It's really best to ask these questions in the chatroom support tab, because it can take quite a few questions to get it straightened out.

Share this post


Link to post
Share on other sites
cjsimon07
1 hour ago, Bryan Walquist said:

@cjsimon07As stated above, SMRT is an IB specific route. SMRTM is a market order, SMRTL is a limit, but unless you have IB, your DAS won't recognize it, and won't adjust the montage properly when you execute a script. You must use whatever is listed in the drop down menu in your montage for route. The first step you'll need to make, is look in the drop down; if it says "LIMIT", replace SMRTL in all your scripts with LIMIT, and anywhere it says SMRTM replace with MARKET, or however it appears in your drop down. The next step for displaying a stop, is to make sure your montage is set to "stop order" style. Right click in lower section of montage, style, stop order. There can be some other setup issues as well, but these will be the first steps. It's really best to ask these questions in the chatroom support tab, because it can take quite a few questions to get it straightened out.

Thanks. I switched the montage style to "stop order" and they seem to be working fine now. I will switch the SMRT scripts with LIMIT or MARKET and see if that helps with the hotkeys. 

  • Like 1

Share this post


Link to post
Share on other sites
cjsimon07

Switching SMRT to LIMIT or MARKET seemed to do the trick. All my hotkeys seem to being working as they should. Thank you for the help! 

Share this post


Link to post
Share on other sites
Bulldog Trader

I'm also having issues with Das and TD. Same issue as above. The hotkeys not are not automatically putting in a stop or stop loss when. Works perfect in demo, but not with DAS/TD. I tried every suggestion in this thread still will not work. I'm having to pace a stop using a second hot key and they just manually sell or cover. Here is my hotkey for 3-1 $50 risk, same one from the room drive. Only thing it does right is calculate the risk an buy the appropriate shares. 

 

CXL ALLSYMB;StopPrice=Price-0;DefShare=BP*0.1;Price=Ask-Price+0.00;SShare=50/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;Price=Ask-StopPrice*3+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS TIF:DAY+;

 

CXL ALLSYMB;StopPrice=Price+0;DefShare=BP*0.1;Price=Price-Bid+0.00;SShare=50/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=200;Price=StopPrice-Bid*3;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS TIF:DAY+

 

Any ideas as to why this will not work?

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.