Thinkorswim AutoTrade Almost T1 204


Welcome!

The web page you landed on is for paid Patreon subscribers. If you are not already one of my paid members than please consider subscribing to support my work. You can subscribe by clicking the orange button named "UNLOCK WITH PATREON" below this welcome message.

Current Subscribers:

What's that? You are already a Hahn-Tech Patron (Tier 1 or higher / $3)? Well then you can use the following link to access the login screen, and click the "LOG IN WITH PATREON" button.
Paid Patreon Member Login
Be sure to bookmark this current page so you can come right back to where you left off before logging in. Thanks again for your support!
To view this content, you must be a member of Hahn-Tech's Patreon at $1 or more
Already a qualifying Patreon member? Refresh to access this content.

About Pete Hahn

For those trying to contact me about our professional services you will find all those details here: https://www.hahn-tech.com/professional-services/ Any questions not related to our professional services or premium indicators should be directed to the comment section of the applicable video or you may post a question in our Q&A Forum: https://www.hahn-tech.com/thinkorswim-forum-topics/

Leave a comment

204 thoughts on “Thinkorswim AutoTrade Almost T1”

  • Khoa

    Pete, appreciate sharing the knowledge. I was looking for “wait until”, “wait for” condition in thinkscript and came across your video. For ex, if RSI crosses below oversold, wait for/until StochasticFast converges (K over D) for at least 2 green candles. I think in the video you use “within X candles” as the time period. What if that X isn’t long enough? We just have to specify X a big number? Is that the only way (i.e. no true wait until condition in thinkscript)?

    • Pete Hahn Post author

      1. Fully automated trading is not supported
      2. We cannot create a Conditional Order that uses Heiken-Ashi candles because those required the use of recursive variables. Which are not supported in Conditional Orders.

      • raviraj hiremath

        Ty. if we give you the requirements would be able to write the code on HA reversals. and how much would you charge?

      • Pete Hahn Post author

        Yes, there are many available platforms that support fully automated trading systems. Some of them are: TradeStation, Sierra Chart, Interactive Brokers, NinjaTrader and Esignal.

      • allen

        Hello Pete, Love the site and the videos!!! Do you know if it’s possible to create TOS Strategy using the conditional wizard? Every time I create a condition with the Condition Wizard, then I add ‘addOrder(OrderType.BUY_AUTO, no);’ the code turns red and it tells me the ‘Condition Wizard doesn’t recognize “addOrder”

        Thanks again for all you do

      • Pete Hahn Post author

        It is very odd that you are asking this question in the comments section of the very video that I would refer to in order to answer your question. I suggest you go back and view the video again and take your time to learn and practice using each of the examples I provided.

    • Pete Hahn Post author

      Depends on the type of alert you are seeking. Thinkorswim has several: https://hahn-tech.com/ans/generate-alerts-from-macdstrat-chart-strategy/
      Aside from the chart study based alerts, most can be created very simply by using the Condition Wizard: https://hahn-tech.com/thinkorswim-condition-wizard/
      If you are seeking a chart study base alerts, then check the “Chart Studies” topic of our Q&A Forum for existing solutions: https://hahn-tech.com/ans/cat/studies/

      • Larry

        I really enjoyed watching your video on autotrade. I like autotrading. Please there is one thing I am still not clear with. At first you created the strategy for both entry and closing into one template but you sent the entry separate and the closing too separate. Is it not possible for both the entry and closing trades to be created one strategy name, such that when the conditions for placing the order are satisfied, the system will execute it and also close trade when conditions too are satisfied? Will be grateful for your response. Kind regards.

      • Pete Hahn Post author

        It is not possible to place both entry order and the exit order at the same time. This is the very reason the word “Almost” is included in the title of this video. Pretty sure I explained that in the video. I suggest you review the video again to make sure you didn’t miss any other important details.

  • Brett Lehmberg

    I used the method you showed in creating a conditional order and it produced “RSILaguerre().”RSI” crosses above 0.2″. In the conditional order screen in the bottom window it showed that it was functioning. When I paste the same code in the strategy creation screen it turns red and says “No such function: RSILaguerre”. Am I missing something?
    def signal = RSILaguerre().”RSI” crosses above 0.2 and RSILaguerre().”gamma” is less than 0.4;
    Thank you for your help!

    • Pete Hahn Post author

      Not much I can do from the comments section of the video. Did you include the template provided and make the changes demonstrated in the video to convert the code generated by the conditional order into code that runs as a chart strategy?

      • Brett Lehmberg

        Thank you for your response. Yes, I copied the line from the conditional order and placed it into the chart strategy just as you showed. In the chart strategy though, it is not recognizing RSILaguerre. I noticed that while in the chart strategy creation screen that the RSI Laguerre study is not in the drop down list on the right where I find all of the other studies. Could that be the problem?

      • Pete Hahn Post author

        The most likely reason for this is that there no such study that is included with Thinkorswim. You must have added this as a custom chart study. In most cases it is not advisable to reference custom study names because it often leads to unexpected results or entirely fails to work. So for custom chart studies it’s best to use the entire code instead of just a reference to it. But that is beyond the technical abilities of the average user.

      • Mario

        There is a way to make an entry and exit with TOS with one order. For example if you wanted to buy when the 9 SMA crosses over the 15 SMA and sell when the 9 SMA crosses under the 15 SMA. This can be made with one order and not creating two seperate orders.

      • Pete Hahn Post author

        Thinkorswim developers have intentionally disabled any known methods for achieving this. If you have a way to work around this issue I suggest you post the solution in the Q&A Forum so the rest of our viewers can evaluate your method and validate it for efficacy.

  • foda

    Pete, You are very talented and gracious in sharing your knowledge with us.

    I have had instances where I have had 4 conditions studies to a conditional order and they were 310 characters. When I saved the order and tried to use it again, TOS had truncated the condition to around 200 characters.

    Have you run into this issue and if so, how did you get around it?

    Keep up the excellent work.

    • Pete Hahn Post author

      This issue has already been posted in our Q&A Forum. Users of Thinkorswim have found that it is not possible to create a Conditional Order, save it as a template, and then use that saved order template to place an order for the same or another ticker symbol. This is an issue that should be submitted to TD Ameritrade support because there is no solution that can be implemented by the end user of the platform. (They have a bug in their platform and it needs to be fixed).

  • Bob

    Very nice presentation and well thought out. Thanks for doing this. But is there a way to save the order as a template so it will be valid for any stock? I’ve created the autotrade from your description and before hitting ‘Confirm and Send’, I saved a custom order template. But when I enter a different symbol and use the saved template (then click on the gear and change the symbol for the study), the order appears but will never execute. I’ve tried this with other studies as well. So my question is: Is there a way to save the order as a global template so all I have to do is select ‘Buy Custom’, select the custom order, select the gear icon, and change the symbol. I have a list of 50 stocks or so that I’d like to trigger if certain conditions are met, but it is way too time consuming to run through the process for each one. Another way to ask the question: Do I have to go through the entire process for each stock that I want to trade automatically?

    • Pete Hahn Post author

      This has already been discussed in the Q&A forum and unfortunately there does not seem to be a way to save a conditional order as a template and apply it to other ticker symbols. Perhaps this is something that should be submitted to TD Ameritrade as a feature request.

  • Richard S

    Hello Pete/ First off, thanks so much for all your generous contributions on this site. I’m trying to create a divergence code that simply compares highest high or lowest low to RSI and MACD histogram for a 20 day period. I was somewhat successful using the study alert in the marketwatch area, but after copying and pasting to the scan tab, it will not produce any results. Any thoughts on what I may be doing wrong?

  • Todd Manger

    Great Video. I am interested in creating trades where my order includes a stop loss is based on the 10 day ATR. How would I implement that?

    Thank you,