Conditional Order using a saved Order Template based on a Custom Study?


Category:
0
0

Hi Pete and All, i have a custom study that generates buy and sell signals based on Rsi and MACD and EMAs
my problem is when i create an order and Reference the study when the Buy singal is true the order goes off ok the first time and the trade is auto executed when the buy signal is generated on the chart,but when saving the order as a template to avoid going through the steps again the order never fires up and i have to recreate it manually again , the first time the Order conditon template generates a code as follows:
script BUY {<< here is the whole study code >>}
plot _Data_ = BUY().”buy” is true;

The second time i try to place the order the code found in the Order Conditon Template is changed and its only BUY().”buy” is true; so the buy singal is generated on the chart but there is no execution

Please let me know why is this happening and why is the Script generated the first time i create the order is shrunk only to ” “buy” is true;” the Second time trying to use the conditional order template .

Thanks in advance

Marked as spam
Posted by (Questions: 2, Answers: 7)
Asked on September 30, 2017 7:49 pm
2391 views
0

Please provide a screenshot of your conditional order. There is a requirement when saving these as an order template. And that requirement is that you need to copy/paste the entire code into the conditional order. You cannot reference a plot from a study, custom or built-in, otherwise the template will not save the order conditions.

( at September 30, 2017 9:47 pm)
1
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:39 pm
0
Private answer

Thanks for replying Pete ,ok the study name is BUY and the plot is “buy” as well , so what i am doing is i am referencing the whole study .

Attachments:
Marked as spam
Posted by (Questions: 2, Answers: 7)
Answered on October 1, 2017 12:41 pm
0

so Pete ,based on your answer , i have to paste the entire script generated by the order template and then save it in the order template and it will stay there?

( at October 1, 2017 12:47 pm)
0

Yes. I needed to to see the screen behind the one you presented in order to get all the details. But I think you have information to get this working now.

( at October 1, 2017 2:16 pm)
0

Thank you so much Pete , i will try what you suggested and hopefully it works , will try on /CL once the futures open
i will keep you posted .

( at October 1, 2017 2:30 pm)
0

Unfortunately , the saved code in the conditional order template gets jumbled up and cut off every time i try to take a trade on the chart when clicking Buy custom , i have to right click on cancel/replace order and go to the order rules window and then recreate the order again by referencing the study ,Pete if you got the time , could you please try it on your end by saving an order template it and trying to use that template to place a conditional order ?
you are actually the only programmer who went that deep into conditional orders in TOS , i can’t find any other video on YouTube that explains it as you do , thank you so much

( at October 2, 2017 5:02 pm)
0

Yes I can certainly do that for you. But I will need your code. I am speaking from experience here. I have already dealt with this issue for another client. If this is not working for you then I need to see if there is something you have missed.

( at October 2, 2017 7:02 pm)
0

Thank you so much Pete ,the thing is i purchased the Study a while back and i would rather share the code through email , the thing is the code works the first time it is referenced as a study but when saving the code as a template and trying to place an order for a second time it gets cut off , i read the TOS manual under conditional orders and i realized it has recursion in the definitions ,that’s why the conditional order template is not saved correctly , some how TOS recompiles it or reformat its code when being used for a second time , i hope when you have the time in the future you would shed some light on the matter , in your video “autotrade almost ” you used a built in study ,but when using a custom study as you mentioned it could be challenging , i will definitely reach out soon if my attempt to semi automation deems profitable .

( at October 3, 2017 5:22 pm)
0

Ok, let me know if I can be of further assistance. If the study has recursion, it is rejected by the conditional order and you never even get the chance to save as template. I have confirmed for another client, that you cannot reference the study in the conditional order. You must place every single line of code in the conditional order, if you want to have any chance of saving as template and retaining the code. I know I’m repeating myself there. But based on your responses there is a chance you missed this in my previous responses.

( at October 3, 2017 5:36 pm)