Auto Place Buy And Sell Orders In ThinkOrSwim

How can we multiple stock in thinkorswim 15 to 20 stock buy or sell together in one click ?
Please help
ToS does not provide the ability to buy or sell a group on stocks in one click.
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Placing live orders from ToS thinkScrit strategies
I've working on my stategy for a long time and now I'm pretty ready. Do you guys know how can I place orders straight from ToS or integrate it somehow so it will place the orders automatically? Thank you.
 
Last edited by a moderator:
Can someone please look at my script and see if an issue is in the script? Orders do appear on the chart and show reports but not triggering. Thanks in advance.
 

Attachments

  • EMA cross with SL Strategy.txt
    2.6 KB · Views: 281
Last edited by a moderator:
Last edited:
I'm trying to code a moving average cross for algo trading on TOS with two stop losses but Condition Wizard won't allow me at add a buy order and short sale order for the same ticker. Has this changed recently within TOS?
For example: I'm trying to tell TOS to buy shares when EMA (1) crosses above SMA(2) and then having a hard stop loss of $0.30 lower than cost basis or whenever EMA (1) crosses below SMA(2). However, when I add a new order to short sell a ticker when EMA(1) crosses below SMA(2), Condition Wizard tells me it will cancel the other existing order.

Also, I'm trying to add a "loop" feature within the code so if the buy trade gets triggered and then sold, TOS will automatically add a new buy order without manual instruction on my part.

If anyone can offer guidance or suggestions, it would be greatly appreciated.
 
The ToS platform does not support automatic buy and sell orders.
Executing trades requires manual input from you.

While ToS provides the ability to set up a conditional order:
https://usethinkscript.com/threads/answers-to-commonly-asked-questions.6006/#post-80482
It still needs to be created manually, and it only executes once.


@samlee @jakin000000 @bkpshah @Kasper777 @firstuser @dominooch
@BAP @TRex50
Thank you for the response back. Do you know if TOS made a change in the last few months because I cannot add a buy trade order and separate short sale trade order for the same ticker in condition wizard? I was able to do that early this year but no longer.
 
Thank you for the response back. Do you know if TOS made a change in the last few months because I cannot add a buy trade order and separate short sale trade order for the same ticker in condition wizard? I was able to do that early this year but no longer.

The bad news is that Schwab has been making many tweaks which weren't supposed to have any effect on our use of the app but ends up having unintentional consequences.

The good news is that they have been very responsive to making fixes when they have been told something needs to be fixed.

The 1st step would be to contact support.
https://usethinkscript.com/threads/how-to-contact-tos-support-for-thinkorswim.11520/
 
I know how to place a limit order manually during pre-market. Does anyone know how to automatically place a limit order during extended hours?
or is there a hot keys in TOS where I can use ?
 
Is there a way to have an automatic profit take and stop loss percentage for any option that I get into? I want to have an automatic 25% profit take and 15% stop loss for every option but I don't know how to make it in thinkscript.

I tried to use a code like this but it didn't work

# Automatic Profit Take and Stop Loss for Options

input profitTargetPercentage = 25; # 25% profit target
input stopLossPercentage = -15; # 15% stop loss

# Calculate profit target and stop loss levels
def profitTarget = close * (1 + profitTargetPercentage / 100);
def stopLoss = close * (1 + stopLossPercentage / 100);

# Create orders for profit target and stop loss
AddOrder(OrderType.BUY_TO_CLOSE, close >= profitTarget, Color.GREEN, name = "Profit Target");
AddOrder(OrderType.BUY_TO_OPEN, close <= stopLoss, Color.RED, name = "Stop Loss");
 
Last edited:
Is there a way to have an automatic profit take and stop loss percentage for any option that I get into? I want to have an automatic 25% profit take and 15% stop loss for every option but I don't know how to make it in thinkscript.

I tried to use a code like this but it didn't work

# Automatic Profit Take and Stop Loss for Options

input profitTargetPercentage = 25; # 25% profit target
input stopLossPercentage = -15; # 15% stop loss

# Calculate profit target and stop loss levels
def profitTarget = close * (1 + profitTargetPercentage / 100);
def stopLoss = close * (1 + stopLossPercentage / 100);

# Create orders for profit target and stop loss
AddOrder(OrderType.BUY_TO_CLOSE, close >= profitTarget, Color.GREEN, name = "Profit Target");
AddOrder(OrderType.BUY_TO_OPEN, close <= stopLoss, Color.RED, name = "Stop Loss");

AddOrder is only for backtesting. It does not create real orders.
There is no automatic trading on the ToS platform.
https://usethinkscript.com/threads/...rders-in-thinkorswim.15540/page-3#post-126271
 
Im relatively new to TOS and have a strategy id like to test but cant quite figure out how to implement it. I am looking for a way to trigger an order based on the size of a spread. So essentially:
  • Security X - Security Y => Value Z. If yes, trigger Market Order for X and Y.
Any ideas on how to get this done?

Thanks
 
hi,
i'd like to create an automated trading order on thinkorswim based on
https://usethinkscript.com/threads/ultimate-macd-indicator-for-thinkorswim.558/
the color-changing chart. green is BUY, red is SELL, and reverse in between.
I'm not a programer, so any help will be appreciated.
thanks.

i've tested this indicator manually and it works beautifully. i am now trying to turn it into an automated trade on TOS, but I'm not sure how to do it. can you help?
 
Last edited by a moderator:
Automated entry based on DELTA

I am looking for some code to short a 30 delta option at a specific time the time of the day with a 200% stop loss. Please advise. TY!

There are 3rd party services that do it for TDA/TOS so there has to be a way...
 
Last edited by a moderator:
There are 3rd party services that do it for TDA/TOS so there has to be a way...

Yes, you can use a 3rd party service.
They create python/C++ scripts that utilizes API on the outside of the ToS app to automate trading.
https://usethinkscript.com/threads/python-thinkscript.16693/#post-131617
However, Schwab is not yet providing new API permissions.

If you work outside the app, obviously you can do anything you want.
But no, there is no automated buying or selling within the ToS app
 
Last edited:
I want to place an automated order to buy at the money call option when a condition (eg: 2 exponential moving averages cross each other on 5 min) satisfies. I know how to place the conditional order but Schwab team is saying I have to specify which call option to buy specifically. For example, buy SPY 497 CALL option when the moving averages crosses each other. But when the condition satisfies, at the money may be SPY 500 CALL. So I want to buy at the money which is SPY 500 call option automatically when the condition met. How do I do that?
 
I want to place an automated order to buy at the money call option when a condition (eg: 2 exponential moving averages cross each other on 5 min) satisfies. I know how to place the conditional order but Schwab team is saying I have to specify which call option to buy specifically. For example, buy SPY 497 CALL option when the moving averages crosses each other. But when the condition satisfies, at the money may be SPY 500 CALL. So I want to buy at the money which is SPY 500 call option automatically when the condition met. How do I do that?
Schwab support is correct.
The ToS platform is not the place to do what you want to do.
 
Looking to make an automatic trading strategy where I look for stocks that are reporting earnings in aftermarket today (a given day), then those that are, see which ones, if any, spikes at least 4% quickly (such as 15 seconds into a new minute aka 4:00.15pm). If it does this 4+% gain within a minute, such as growing 4% in 30 seconds, then I'd like to buy that stock (make a limit buy) asap. Then, I'd like to sell the stock at the end of that minute period; if I bought the stock at 4:00.30pm (30 seconds into the minute), then sell the stock at 4:01pm. I'd like this script to run automatically as much as possible, look for each day's stocks with earnings being announced....

Any suggestions for how to accomplish this?
 
Looking to make an automatic trading strategy where I look for stocks that are reporting earnings in aftermarket today (a given day), then those that are, see which ones, if any, spikes at least 4% quickly (such as 15 seconds into a new minute aka 4:00.15pm). If it does this 4+% gain within a minute, such as growing 4% in 30 seconds, then I'd like to buy that stock (make a limit buy) asap. Then, I'd like to sell the stock at the end of that minute period; if I bought the stock at 4:00.30pm (30 seconds into the minute), then sell the stock at 4:01pm. I'd like this script to run automatically as much as possible, look for each day's stocks with earnings being announced....

Any suggestions for how to accomplish this?
Hi mate,
After reading your post, I am assuming you already have a scanner that reports your position candidates? Even if TOS had support for auto-trading, I would not suggest scalping after regular market hours. There is no guarantee your order would be filled.
 
I've spent a considerable amount of time developing my trading strategy on ThinkorSwim (ToS) thinkScript, and I'm now prepared to execute live orders.
Can anyone advise on how to directly place orders from ToS or integrate it for automated order placement? Appreciate any guidance on this matter.
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
293 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top