♥ 0 |
Hi, thank you for your YouTube video on semi-automated roundtrips using conditional orders referencing studies. MyStudy.StopPrice = Y; MyStudy.LimitPrice = Z; Thank you. PS: I’m pretty good with ThinkScript but haven’t found an option to pass parameters to close the loop on semi-automated trading.
Marked as spam
|
Private answer
I will begin by reminding our viewers where to locate the video mentioned in this request: https://www.hahn-tech.com/thinkorswim-automated-round-trip-trades/ Within that video, I was very clear to explain that users should avoid referencing custom studies when building conditional orders. Instead, the entire script of the custom study should be copy/pasted into the conditional order editor. We have already disclosed in other posts on this forum that trying to create a reference to a custom study within a conditional order often results in performance that does not match expectations. The conditional order tools on Thinkorswim are exceedingly fragile. So long as you keep things very simple, they are robust in their operation. But as you increase the complexity, the tool becomes more fragile and less reliable. Now that I have clearly cautioned everyone about these limitations, I will attempt to directly address your question. When you apply a script to a conditional order, that order is only triggered once the condition is true. So to begin with, you must have a true/false condition, or you have nothing to trigger an order. Passing values from other studies is a trivial matter on Thinkorswim . We do this by referencing the plots from another study (just as you described in your theoretical example). But when you are building script for a conditional order, the end result must be a true/false condition. So passing values for sell price, stop price or target price is not sufficient to trigger an order to be sent to market for execution. If you check the 21:30 time stamp on the video you will see I have completed the entry side of the conditional order and the very next step shows how to create the exit side. You will notice the exit side is based on a true/false condition. The only way we could use a numeric value to trigger the exit side would be to use something like this:
Or you could use something like this:
Let me try to summarize this. The video I referenced above shows the absolute limits of what is currently possible. I have not held anything back. If you don't see it demonstrated in that video, it's simply not possible. Which means if you want to automate an OCO bracket order, you must
Passing parameters from custom chart studies is a trivial matter for someone with your experience, as evidenced from your examples. Just remember that the best way to use this tool is to AVOID referencing custom studies, and use the actual script in your conditional orders instead. Which means I am advising everyone to entirely avoid "passing parameters" to conditional orders. But for those who want to ignore my recommendations, I have at least laid out the foundation from which those could be utilized and the framework within which they can be applied. Marked as spam
|
Please log in to post questions.