Strategy to create automatic orders


Category:
0
0

Hi Mr Hahn, love your site!  I’m just getting started using this thinkscript and trying to play around with first Strategy, I want to make something basic that can put in an order automatically for me to learn how this works, I just can’t seem to get the strategy to fire off an order. Also how would you create a TRG W/ Bracket order with this ThinkScript strategy, looking through their documentation i can’t locate it.  Appreciate any help.

 

def buySignal = open > high[2];
def sellSignal = open < low[2];
AddOrder(OrderType.BUY_AUTO, buySignal, open[-1], 1, Color.YELLOW, Color.YELLOW, “Buy”);
AddOrder(OrderType.SELL_AUTO, sellSignal, open[-1], 1, Color.RED, Color.RED, “Sell”);

Marked as spam
Posted by (Questions: 2, Answers: 2)
Asked on April 30, 2020 5:04 am
286 views
0
Private answer

Don't shoot the messenger. But everything You have stated in your question is completely impossible. Not sure which of our videos you have already viewed. But none of our tutorials even suggest or imply that any of this might work the way you have described.

Before getting into the details, writing chart strategies is extremely advanced coding. If you are just starting out you should not be writing any code for chart strategies for at least 12-18 months.

Now for the details. It is completely impossible for any chart strategy on Thinkorswim to execute actual trades. It never was possible and given their stance on this topic it never will be possible.

Bracket orders are completely impossible to code in chart strategies or for that matter any code you might apply anywhere on the platform.

So, let's get you started at the very beginning so you can get a good foundation of knowledge before you loose your mind trying to things are not possible. Writing code can be frustrating enough but when you try to do something that is impossible it can cause panic attacks and excessive drinking. (among other sorts of unhealthy behavior).

Here is a link to the videos in our Chart Strategies topic:

https://www.hahn-tech.com/category/tos/strategies-tos/

When you open that link you want to go straight to the left-hand side menu. There you will find a list of all the videos in this topic. For the most part, the videos are listed in the order from beginners to advanced. So watch them in that order. Don't skip around. Each video builds upon the knowledge of the first. The very first video, the most basic video where all beginners should start, will explain that none of what you are attempting to do is possible in Thinkorswim.

Final note. Writing chart strategies is only used to back test your trading ideas. You can't use them to trade. But you can take elements of your chart strategy and apply them to semi-automated trades (there are limitations here which will be explained in those videos).

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 30, 2020 7:27 am
0
Great thanks for the explanation, have you done any work the developer API for thinkorswim. This is were i'm assuming you can build automated trades. I know i'm not there yet and i'm going to read over the great info you sent. Appreciate you helping me find the information i need.
( at April 30, 2020 8:36 am)
0
I am aware of the API provided through TD Ameritrade but I have not taken the time to learn how to build solutions for that. In order to automate trades through the API would require that you build an entirely stand alone platform. From the ground up. Waste of time for the average home gamer. Only useful if you plan to build a program and sell it to the general public. If you want to build fully automated trading systems you should move to a platform that supports it natively. Much fewer headaches and complications. I build automated trading systems for TradeStation. Not for the novice. I have well over 20 years of experience in enterprise level software development and automated trading systems are challenging even for someone with my level of experience. Most folks THINK they want an automated trading system but they have no idea what they are getting themselves into. Before you spend one more second trying to learn how to build one you need to read the following article: https://www.hahn-tech.com/automated-trading-systems/
( at April 30, 2020 10:42 am)
0
Appreciate it Pete, yeah I don't have tons of experience in alot of trading platforms but thinkorswim seems to have all that i need, now you helped explain strategies and how they work its starting to come together on how to use this tool to its max potential. I just don't see why if you have a strategy that is producing you good results within the system, why wouldn't they take it one step further to automate or implement your strategy by automation? Of course being able to put safeguards in place where needed but that would be up to how you build your strategy. For some reason i just like the idea of efficiency and human automation where possible.
( at April 30, 2020 11:47 am)
0
Private answer

New features have been enabled in Thinkorswim which provide fully automated round trip trades. Meaning we can now automate the entry and the exit and we can daisy-chain multiple stages within the order sequence so that multiple round trip trades can be accomplished automatically. In addition to this, we can save these orders as an order templates so they can be reused with very little effort.

Check the following video for the full details:

https://www.hahn-tech.com/thinkorswim-automated-round-trip-trades/

 

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 18, 2022 1:27 pm