Auto Place Buy And Sell Orders In ThinkOrSwim

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

Hello everyone,
I am a new to Thnikscript and using the below script, which shows the crossover including arrows when it happenes but the code doesn;t BUY or SELL automatically, any reason why. Thanking you in advance.

+++++++++++++++++++++++++++++++++++

input longEntries = yes;
input ShortEntries = no;
#-------------------------------------------------------
# For future , we would always like to trade only "1" contract, at a time
#-------------------------------------------------------
input qty = 1;
input FastEMALength = 13;
input SlowEMALength = 48;
input AverageTypeFast = AverageType.EXPONENTIAL;
input AverageTypeSlow = AverageType.EXPONENTIAL;

plot fastMA = MovingAverage ( AverageTypeFast, close, FastEMALength );

plot slowMA = MovingAverage ( AverageTypeSlow, close, SlowEMALength );

AddOrder ( OrderType.BUY_TO_OPEN , ( longEntries) and fastMA crosses above slowMA, close, qty);

AddOrder ( OrderType.SELL_TO_CLOSE, fastMA crosses below slowMA, close, qty);


AddOrder ( OrderType.SELL_TO_OPEN, ( ShortEntries ) and fastMA crosses above slowMA, close, qty);

AddOrder ( OrderType.BUY_TO_CLOSE, fastMA crosses above slowMA, close, qty);
++++++++++++++++++++++++++++++++
 
Hello everyone,
I am a new to Thnikscript and using the below script, which shows the crossover including arrows when it happenes but the code doesn;t BUY or SELL automatically, any reason why. Thanking you in advance.
The above script is for testing purposes only. The ToS platform does not support auto buying/selling.
 
Thanks MerryDay, you mean there is an issue with trhis script or for any indicator the automatic buy / sell doesn;t work ??

so that mean do I have to take an action of buy and sell for each crossover ??

Since so far mainly I am using TOS for options and want to explore more for micro futures trading, I have been using Nionja traders which does allowes strategy to buy/sell as per your code, so want to know if TOS support the same or not ??

Thanks
 
one more question , in that case what is the use of ADDORDER function ?? just want to know if it doesn;t perform buy/sell ??
AddOrder is for backtesting purposes only. The ToS platform does not support auto buying/selling. Orders can be placed manually or there
is limited conditional orders that can be placed but they are one-time only and then expire.
 
Thanks a lot MerryDay for your reply. Appreciate your help. I was under impression that like as many other tools for trading we can do the same here in TOS too, but good to know. appreciate your help.
 
Hi Everyone,
Is there a way to enter Long when the price crosses above a Trendline and enter Short when price crosses below the same trendline. I have seen similar things done with SMA and other Studies but not with a trendline. Any idea
 
@moxiesmiley For example in Thinkorswim i draw a Horizontal trendline somewhere on the chart and now want the trades to be automade across that line.
Autotrade is not available in the ToS platform.
Nor can Conditional Orders interface with manual drawn artifacts.
 
I have been able to Auto generate Signals using [ plot signal = if low crosses above or high crosses below ( given price) then 1 else 0;].
Here low/high refers to candle stick's low/high and i think changing it to Market price might achive the goal.
 
I have been through the Condition Wizard thoroghly. The limitation here is it executes the order only once and not after that whenever the condition is met.
 
@MerryDay Ah, got it. It seems alot of traders are stuck in the same situation. Hopefully we will find a way. Thanks alot for the help, much appreciated.
 
Can anyone please help me with this?
Can ThinkScript put a stock buy/sell order automatically?
Can ThinkScript write something like "result: 30.50; time: xxx; result: 10.00; time: yyy;" automatically to my local computer drive?

From what I have read so far, thinkscript cannot put stock buy/sell order automatically, thinkscript cannot write to local computer. But I am still hoping there is a way to do that.

I am thinking to do testing, when a condition is met, I'd like to write some information on my computer. Thanks!
 
Can anyone please help me with this?
Can ThinkScript put a stock buy/sell order automatically?
Can ThinkScript write something like "result: 30.50; time: xxx; result: 10.00; time: yyy;" automatically to my local computer drive?

From what I have read so far, thinkscript cannot put stock buy/sell order automatically, thinkscript cannot write to local computer. But I am still hoping there is a way to do that.

I am thinking to do testing, when a condition is met, I'd like to write some information on my computer. Thanks!
The ToS platform does not provide a means for auto-trading.
https://usethinkscript.com/threads/auto-trade-algo-in-tos.7546/


Members have exported data to excel. I am not sure that all the data you are looking for is available.
https://usethinkscript.com/threads/...a-from-thinkorswim-for-external-analysis.507/
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
473 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