No Orders showing on the chart when using the autotrade code


Category:
0
0

Hi Pete,
Thanks for the video and the code at https://www.hahn-tech.com/thinkorswim-autotrade-almost/
I copied the code (from the strategy template) and pasted it into a new study on a 2 min time chart for /TF, but I do not see any orders show up on the chart, like in your video. I have tried various things and the buy/sell orders refuse to show. I even opened TOS from a different computer :). Any ideas

Thanks,

Hilario

Marked as spam
Posted by (Questions: 4, Answers: 5)
Asked on January 5, 2017 4:48 pm
159 views
1
Private answer

Yes Hilario, after opening your shared chart you have confirmed my analysis. You have a template here and nothing more. It’s a shell. You need to add your conditions to before it will display any orders. The technique for building the conditions is covered in great detail in the video where you copied this code. Numerous examples are provide in the video.

I know you said you went back and watched the video again. But you missed the most important steps.

The steps you missed are shown from the time stamps 12:47 through 23:40

https://www.hahn-tech.com/thinkorswim-autotrade-almost/

After following those steps you should end up with this:

input tradeSize = 100;
def signal = RSI()."RSI" crosses above 25 and low crosses below BollingerBands()."LowerBand" within 8 bars;
addOrder(OrderType.BUY_TO_OPEN, signal, open[-1], tradeSize, Color.CYAN, Color.CYAN);
def exit = RSI()."RSI" is less than RSI()."RSI" from 1 bars ago and high is greater than BollingerBands()."UpperBand" within 4 bars;
addOrder(OrderType.SELL_TO_CLOSE, exit, open[-1], tradeSize, Color.MAGENTA, Color.MAGENTA);

Please don’t just take the shortcut of copying and pasting this code. Make sure you can build this yourself by following the steps in the video. Once you understand how the process works you can create your own custom strategies without writing any code at all.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 8, 2017 12:53 pm
0
Private answer

Ok if you copied the code from that web page you have copied only the template that I provided. In the video I demonstrate several instances of creating your own custom criteria using the Condition Wizard. And I show how to copy that code from the Condition Wizard and paste it into the template. If you have skipped this step and only pasted the template, then of course you would not see any orders show up on the chart. So let me know if this helps. If not, then please post you own code, (including your custom criteria from the Condition Wizard), so I can test it for myself.

Don’t forget to up-vote any answers that you feel are the best solution to your question!

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 5, 2017 5:11 pm
0
Private answer

Hi Pete, I went through the video again, but somehow could not get it to show the orders. I am probably missing something.

Here is my grid http://tos.mx/hAizwR (it includes the code as a study)

Thanks, Hilario

Marked as spam
Posted by (Questions: 4, Answers: 5)
Answered on January 8, 2017 11:44 am