Ultimate Beginner's Guide to Automated Trading in ThinkOrSwim (2024)

Поділитися
Вставка
  • Опубліковано 23 гру 2024

КОМЕНТАРІ •

  • @TOSIndicators
    @TOSIndicators  4 роки тому +20

    We cover 8 different trade scenarios in this tutorial.
    Here are video timestamps that might come in handy:
    0:01 - Automated Trading Intro
    1:25 - Who We Are
    3:54 - What Will We Discuss in this Tutorial
    5:42 - Why Automated Trading?
    8:57 - What is the Automated Trading Triggers Window?
    10:55 - 8 Trigger Scenarios That We Will Build
    15:05 - Scenario 1: Nightly Trending List
    18:47 - Scenario 2: Iron Condor When in Consolidation
    23:56 - Scenario 3: Automatic Covered Call for Income at Fib Extensions
    27:40 - Scenario 4: Buy Put When RSI Shows Bearish Breakout Signals
    32:01 - Scenario 5: Buy Stock on Pullbackto 34 EMA
    36:34 - Scenario 6: Sell Position When Squeeze Loses Momentum
    39:37 - Scenario 7: Layering on Multiple Indicators
    44:55 - Scenario 8a: Buy on Implied Volatility Pullbacks (Entry)
    47:01 - Scenario 8b: Sell When Trend Breaks
    53:04 - What Else Can I Do?
    Hope you enjoy this tutorial!

    • @mikeferrato3553
      @mikeferrato3553 2 роки тому

      Thank you for the amazing content. I have a question about tying your limit order to the ask/bid. Can you explain how thats different from a market order?

  • @mikedonline2179
    @mikedonline2179 Рік тому +1

    Thanks for the great video! One point I noticed at 22:18 - the Ask/Bid, according to the manual is "... either the bid or the ask price plus the offset specified as an absolute value. The system automatically chooses the ask price for Buy orders and the bid price for Sell orders." I believe you want to select MARK which is the mid-point and you can modify the offset amount.

  • @marketshareclub7464
    @marketshareclub7464 2 роки тому +4

    Great content !! Thanks for sharing such a great tutorial and for explaining in simple terms how everything works. We need more traders and contributors like you ! I will look at the rest of the content in your channel, it looks fantastic.

  • @samdoral4927
    @samdoral4927 2 роки тому +1

    Thanks you, Loved it, Have a scenario & wanted to know if I can manage by scripting. I've two OCO orders one for long & the other is for Short on the same stock & both have entry/exit & stop. Is there was I can connect both where if the long one is executed, short will be cancelled and vice-versa. Incase you have a script available already appreciate if you can share pls. Thanks in advance.

  • @samdoral4927
    @samdoral4927 2 роки тому +1

    Great video on Advanced scripting on ThinkOrSwim

  • @garthwilliams8069
    @garthwilliams8069 2 роки тому

    WOW. Great vid. Those ideas for triggers really make you think about finding and or setting up positions in a truly customized fashion.

  • @hakenly
    @hakenly 4 роки тому +6

    This is awesome exactly what I was looking for, very detail work and explanations

    • @TOSIndicators
      @TOSIndicators  4 роки тому

      Glad you liked it!

    • @hakenly
      @hakenly 4 роки тому

      TOS Indicators Instead of having a line that moves up when the signal occurs, how would I change it to show just 1 arrow when the signal occurs?

    • @TOSIndicators
      @TOSIndicators  4 роки тому +1

      You could use boolean arrows to change the plot. Documentation here: tlc.thinkorswim.com/center/reference/thinkScript/Constants/PaintingStrategy/PaintingStrategy-BOOLEAN-ARROW-UP

    • @hakenly
      @hakenly 4 роки тому

      @@TOSIndicators Thanks I've tried that already, but it can draw a long continuous row of arrows when the signal is true for several bars in a row. I want to just have only 1 arrow drawn when the 1st signal is true and if the next several bars are also true not to continue drawing the arrows until the signal ends.

    • @TOSIndicators
      @TOSIndicators  4 роки тому +2

      Right. You'll need to factor that into your boolean condition, checking if the signal was true on the current bar, and not the previous bar.

  • @sujaydutta
    @sujaydutta 3 роки тому +1

    Really nice tutorial!

  • @sidneyvongshivit6313
    @sidneyvongshivit6313 3 дні тому

    can you automate TTM Squeeze Histogram Backtester

  • @ninoachay5739
    @ninoachay5739 Рік тому

    Is there a way to input a repeat everytime those conditions happen and run it on the on-demand for backtesting?

  • @Randall1906
    @Randall1906 3 роки тому +2

    Outstanding; thank you!

  • @KPSoundCo
    @KPSoundCo 2 роки тому

    How about triggers based off premarket levels on options with different strike alerts triggered off the pre market levels

  • @martyfrancom7148
    @martyfrancom7148 2 роки тому

    I have figure out how to create a custom BUY/SELL using the MACD-Histogram CrossOver Study. I would like to be able to do the same with the HA CrossOver Study. There doesn't seem to be any such study. Can you be of any assistance in creating a HeikenAshi
    -CrossOver Study ?

  • @mistletoe91
    @mistletoe91 Рік тому

    But how to do risk management ? E.g. The alog should calculate quantity based on risk $$$. So how to do that ?

  • @silverback283
    @silverback283 7 місяців тому

    Code for TTM losing momentum does not seem to work. Is there any update?

  • @aniljadhav9408
    @aniljadhav9408 4 роки тому +4

    Pretty well articulated.

  • @Forgottennowfound
    @Forgottennowfound 4 роки тому +1

    I do not have the ability to have a study trigger an action on the on demand side of TOS? That kinda sucks how do you back test?

    • @TOSIndicators
      @TOSIndicators  4 роки тому

      You can backtest in ThinkOrSwim using the "Strategies" functionality, and write your own thinkScript to give you some basic reporting.
      An additional benefit with that is you can leverage the same backtest thinkScript code in the Automated Triggers tab (assuming it passes the complex equation test).

    • @SuperDanny1016
      @SuperDanny1016 4 роки тому

      OnDemand is not the same as PaperMoney. You'd need to log into to the PaperMoney account in order to run the studies since OnDemand doesn't support ThinkScript.

  • @brentg245
    @brentg245 2 роки тому

    Is there anyway to automate the share size or number of contracts? For example, if I can write a script to determine my stop and base my number of shares to purchase off of that can that be incorporated? What about "looping" the order to hit some total dollar amount? Really just trying to automate number of shares based on using a def and simple math, but first glance it doesn't look possible

  • @Dori_1111
    @Dori_1111 Рік тому +1

    Excellent video. It's a shame there is no option for 'tick' timeframe so I could use this for my scalping strategy. The minimum is 1 min.

  • @seek3n
    @seek3n 2 роки тому

    is it possible to set a percentage in between the moving average? Let say all three must be within 0.01% to 5% so it really makes it stacked

    • @TOSIndicators
      @TOSIndicators  2 роки тому

      Hi there - yes, that should be possible, though would need to be a custom script.

  • @outlaw4016
    @outlaw4016 4 роки тому +6

    This is awesome... so it automatically executes the buy and sell orders? So you can just run one of these and go AFK?

    • @TOSIndicators
      @TOSIndicators  4 роки тому +1

      In theory, yes... but does require you to re-submit the order every time (incl. the sell-side scripts).

    • @iameladlevi
      @iameladlevi 4 роки тому

      TOS Indicators
      Thanks!
      So there is no easy build in was to get strategies running / demo backtested using TOS?
      E.g. macd strategy on SPY
      Without me defending it after every trade?
      Much appreciated your work!

  • @stephenhobbs948
    @stephenhobbs948 4 роки тому +1

    thanks! Very valuable.

    • @TOSIndicators
      @TOSIndicators  4 роки тому

      Thanks Stephen! Glad you found the tutorial useful.

  • @dumbcat
    @dumbcat 3 роки тому

    can you save these and attach them to hotkeys?

  • @hafidinvest9052
    @hafidinvest9052 2 роки тому

    Hello I have a study but it is not working. It's much less simple than this, but it doesn't work. The algorithms don't seem to work well and don't take commands seriously. can I communicate with you

  • @kasusista3317
    @kasusista3317 3 роки тому +1

    This is fantastic. Thank you.

  • @fabianflores-jasso4057
    @fabianflores-jasso4057 4 роки тому +4

    Yet another GREAT video!!
    Perhaps you can help me. I’m trying to automate a bullish and bearish entries/exits signal for the same stock. But I am confused about how the platform recognizes the exit bullish signal from the bearish entry signals. Also, I am not sure how to enter them in the Trade tool, should they be added separate, in order words the bullish entry/exit from the bearish entry/exits?
    Thanks again!!

    • @TOSIndicators
      @TOSIndicators  4 роки тому +1

      Hi Fabian - based on your strategy and the code, the bullish and bearish signals would be "plot" variables, which you could then reference via exampleFunction().bullishSignal. Depending on the complexity of your code, TOS may give you a "complex error" if you try to combine too many variables/calculation (with both bullish and bearish). If you face that error, then you can trim down your code... as necessary :-).

  • @xueyuan1
    @xueyuan1 4 роки тому +1

    awesome post! Thanks

  • @SamAgro2024
    @SamAgro2024 3 роки тому

    Great Video. is it possible to create a custom template with a condition so that my sell orders will cancel automatically 5 mins before market close. Right now, i can only specify a date and time and that date becomes past if i use the template for a new order in the future.

    • @TOSIndicators
      @TOSIndicators  3 роки тому

      You might be able to get away with using the "SecondsTillTime" function to link it to 5 mins before the market closes, instead of specifying a date/time. However, once the order gets triggered for the first time, you will need to re-submit for future orders.

  • @aliasirealestate1053
    @aliasirealestate1053 3 роки тому +2

    As usual, amazing informative clip.
    1. I think for the first scenario, the main order should be submitted as a “STOPLIMIT” order. Otherwise, if the order is submitted the way it is, it will get an immediate fill since the LIMIT price is over “ASK” price. I guess the whole intention here is buying the stock if it is building up momentum and shooting past a higher price.

    • @caitlynbli
      @caitlynbli 3 роки тому

      in the code cross above set it already.

  • @Stealthy_Sloth
    @Stealthy_Sloth Рік тому

    How can we paper trade options on TOS?

    • @TOSIndicators
      @TOSIndicators  Рік тому

      Just need a TOS account switched to Paper Trading mode and you should be able to trade via the options chain on the Trade tab.

  • @guangyang3840
    @guangyang3840 4 роки тому +1

    is it possible to trade continuously. For example if fast Average line cross above (below) the slow average line, thinkscript can do automatically and continuously? Or u have some alternative ways. Thanks in advance.

    • @TOSIndicators
      @TOSIndicators  4 роки тому +1

      Not that I'm aware of - each new entry and exit order needs to be re-submitted in TOS.

    • @cgsews
      @cgsews 2 роки тому

      You can do up to 8 legs for continuous buying and selling which would be 4 buys and 4 sales on the same trade.

  • @naeemsemerkant8893
    @naeemsemerkant8893 4 роки тому +2

    Where do you recommend back testing your trading strategies and running them live? TOS does not seem to have very comprehensive back test reports and the automated trading is limited

    • @TOSIndicators
      @TOSIndicators  4 роки тому +2

      If you're familiar with Python, Quantopian offers a fairly robust platform that is powerful enough to backtest with nuances that you'd need to truly replicate an automated-trading bot (i.e. drawdown, account ratios). The downside is their platform integrates with Robinhood, but you may consider using it purely to backtest your strategies as well.

    • @jorgensoby5322
      @jorgensoby5322 4 роки тому

      You can put on floating pnl with strategies on your chart go to studies and put on a strategy

    • @ygtcbee23
      @ygtcbee23 3 роки тому

      @@TOSIndicators, unfortunately, Quantopian has pivoted away from the crowdsourced hedgefund model. they no longer offer the tools to public as they once did

  • @naweedsyed4152
    @naweedsyed4152 4 роки тому +1

    Amazing video thank you 👍

  • @JE-md6gd
    @JE-md6gd 3 роки тому

    Can you semi-automate Futures trade? Thanks

    • @TOSIndicators
      @TOSIndicators  3 роки тому

      I believe so, but I would test thoroughly in paper-trading esp. with futures. The benefit of stocks is being able to trade with as little as 1 share in live money, vs. your lowest risk form to test in futures would be the micros.

    • @cgsews
      @cgsews 2 роки тому

      yes, if you need help, call their support line.

  • @naina9283
    @naina9283 3 роки тому

    Are secondary aggregations allowed for the buy/sell conditions?

  • @ukdukd3451
    @ukdukd3451 3 роки тому

    Scenario 7 giving error at volume line, is it possible to correct?

    • @TOSIndicators
      @TOSIndicators  3 роки тому

      You can download our code directly from our website, and compare against your own code to see where you may be facing issues: tosindicators.com/indicators/automated-trading

  • @robertskrob765
    @robertskrob765 3 роки тому

    Awesome! Any way we can use custom thinkscript code that’s not based on an indicator for placing orders? Like the ATR Trailing stop? That’s built into charts but not the order entry script selection, May need to define signal? Thoughts?

    • @TOSIndicators
      @TOSIndicators  3 роки тому +2

      Hi Robert - I think you could use the "ATRTrailingStop()" study, which is built inside of ThinkOrSwim, and use that to link (and test) to a trigger condition. Not sure if it would work, but it's a good starting spot, and use that code to test / tweak. You also have access to the source code inside of TOS, if you'd like to define the signal yourself.

    • @robertskrob765
      @robertskrob765 3 роки тому +1

      Thank you! I had never seen the “define signal” before. That’s huge if I can get it to work. This would mean every study, both default and customized is fair game for an entrance or exit. Very impressive!

  • @hamelbus
    @hamelbus 4 роки тому +1

    Hi, I tend to trade using range bars. Is there any way to automate trades on thinkorswim using range bars instead of time-based aggregation? When setting up the order condition, it seems like only time-based is available (ie. day, min, month etc..). Thanks!

    • @TOSIndicators
      @TOSIndicators  4 роки тому

      Hi there - I'm not aware of a way to go from time-based bars to range-based ones, for the scripting conditions. Sorry!

  • @tmtrader17
    @tmtrader17 3 роки тому

    Do you know if it’s possible to use other time frames that aren’t given for the order conditions?

    • @TOSIndicators
      @TOSIndicators  3 роки тому

      Hi Teddy - I don't believe that's possible.

  • @robbertorizalino3648
    @robbertorizalino3648 4 роки тому

    Have you have a trial, or we tried it lose or win. ?
    Can it be applied in option trading.

    • @TOSIndicators
      @TOSIndicators  4 роки тому

      The tutorial covers a few different scenarios that you can try to apply, including options trading.

  • @deemo16
    @deemo16 4 роки тому

    ibridgepy can now be used to automate TD accounts. Also (I haven't watched this entire video, but perhaps this was mentioned), you can't use reversion programming to trigger automated events. This prevents most complex trading concepts. For instance, you can't use VWAP to trigger trades (please correct me if that has been fixed)! When you attempt to calculate things like VWAP it errors.

  • @tsteins1579
    @tsteins1579 4 роки тому

    Do you see it as a possibility to have an algorithm that swings for you depending on SMA's? Ex: Purchase when the price opens above the 50SMA and sell when the price closes below the 50SMA.

    • @TOSIndicators
      @TOSIndicators  4 роки тому

      That should be possible - the 50 SMA should most likely not trigger the Complex Exception error.

  • @jeepjr
    @jeepjr 4 роки тому

    would have how to make a grid with leverage

  • @אלילוזן
    @אלילוזן 4 роки тому

    Thank you so much for the detailed and beautiful video,
    I wanted to ask ,
    Sample buying conditions , buy only once, and the condition ends,
    Can a condition be repeated over and over again,
    For example: if the price went up in cents, buy ,
    And then every cent that costs the system will automatically buy again and again?

    • @TOSIndicators
      @TOSIndicators  4 роки тому

      Not that I'm aware of - the thinkScript needs to be copy/pasted each time, and the trigger condition "re-submitted."

  • @jimmyvo4021
    @jimmyvo4021 4 роки тому

    Hello, is there a way to sell a indicator if one comes before the other such as: Sell if 50 SMA < 200 SMA or RSI > 70 (which ever comes first)? Or would you just make 2 sell orders?

    • @TOSIndicators
      @TOSIndicators  4 роки тому +1

      You could use the "or" condition, with each indicator set in its own boolean condition. I would thoroughly test this in Paper Money, though.

  • @ryanvaupel9871
    @ryanvaupel9871 4 роки тому

    Hello. My order condition screen doesn't display the AlertValue bar at the bottom. How do I add it?

    • @TOSIndicators
      @TOSIndicators  4 роки тому

      Hi Ryan - Not sure what you mean by this, but if you are missing the screen altogether, that would be a question for TDA to help you debug your instance of the platform.

  • @chunyuchiu3290
    @chunyuchiu3290 4 роки тому

    for scenario 5, will the buy order still be submitted if my thinkorswim platform isnt open?

    • @TOSIndicators
      @TOSIndicators  4 роки тому

      As long as the submitted order is still an active order, it should be submitted if the conditions are met.

  • @coachcleats13
    @coachcleats13 4 роки тому +1

    perfect!!

  • @SaveManWoman
    @SaveManWoman 4 роки тому

    The cost?

  • @mattd7770
    @mattd7770 4 роки тому +1

    Great video. Thank you. But your right, there are some real limitations. No conditional orders during extended hours?!? WTF?!?

  • @pttrader7373
    @pttrader7373 4 роки тому

    I tried to input my code and saved it as a custom order but upon opening the saved order again, the code is cut and not showing all of the codes. Can this be fixed?

    • @TOSIndicators
      @TOSIndicators  4 роки тому +3

      I'm not aware of a way to save an order template to keep re-using the same piece of code. The alternative that I've found to be more reliable is save the code as a separate .txt file locally, to copy/paste in any time the same order condition code is needed.

    • @pttrader7373
      @pttrader7373 4 роки тому

      @@TOSIndicators thank you very much! I am doing that right now

  • @aliasirealestate1053
    @aliasirealestate1053 3 роки тому

    2. For the second scenario, the order time frame cannot be DAY. Obviously, the last day closing price did not meet the criteria, otherwise, there was no need for deploying any code and one could sell the CONDOR on the get-go. This code cannot be triggered with today’s closing price because by definition when we learn today’s closing price, the market is already closed and our order is expired. In conclusion, either we have to change the order to GTC or GTD. Question: “if I want to run this code on a daily chart but if I intend to trigger the order soon after the ticker price comes within that range, what variable should I be using instead of CLOSE? so it would be reflective of instant stock price, not daily closing price.”

  • @liuzuoyi7008
    @liuzuoyi7008 4 роки тому

    The Scenario 1 is wrong. Your condition should be to buy MSFT if the price is cross over $179.18 in first 15 mins. But you submit the OCO at buy MSFT at $179.18 and the last price is $178.6 which is lower than $179.18. So when you submit the OCO order for Scenario 1, it will execute at $178.6 or lower price and it is possible that the price will not cross over $179.18 in first 15 mins. Could you make a correction for the scenario 1?

    • @TOSIndicators
      @TOSIndicators  4 роки тому +1

      Hi Liu - Scenario 1 is correct, along with the code. The conditional order for entry (not the OCO) is at whatever price the VB levels suggest (using a STOP, not a LIMIT order). The order will only trigger if our conditions are met, after which the OCO orders are automatically in place. If the order does not trigger by 6:45 am PT, the order automatically cancels using the time based triggers.

    • @TOSIndicators
      @TOSIndicators  4 роки тому +1

      Scenario 1 uses a hard-coded VB Level via a stop limit order (stop if you don't care about gaps), with a time-based order expiration. Feel free to email us at contact@tosindicators.com if you need any further clarification.

    • @jm3280
      @jm3280 4 роки тому

      @@TOSIndicators Yeah, this is confusing to me, too. Your buy order is a limit order higher than present price... Why wouldn't this immediately execute?

  • @andyatmosphere
    @andyatmosphere 3 роки тому

    You’d have to go to Alpaca Trading and use Python to have fully automated trading.

  • @hackmedia7755
    @hackmedia7755 2 роки тому

    looks like I need to use the python API to get fully-automated.