♥ 0 |
Is there anything wrong with below script that is not working with conditional order? declare lower; def deltaClose = deltaClose[1] + delta; def priceAtBuy = close(period = aggregationPeriod.FIVE_MIN) – deltaClose; def salePrice = close(period = aggregationPeriod.FIVE_MIN) * 1.05; plot signal = priceAtBuy < salePrice; RESOLVED
Marked as spam
|
Private answer
I will explain why your code is not supported in the Conditional Order tool on Thinkorswim.
Where is this reference to secondary aggregation? Here:
Each section of code which includes this reference is not supported in the Conditional Order tool. If you paste your code directly into a Conditional Order you will find it generates an error stating "Secondary period cannot be less than primary". And this error persists no matter what time frame is selected for the Conditional Order. However if you tried to save this as a custom study and used only a reference to the study in the Conditional Order the compiler may miss this. Which is why we always recommend that we never reference custom chart studies in this tool. We always want to use the entire code. Where is the recursive variable?
Any variable which refers to a previous value of itself ( For those interested in learning how to avoid these types of mistakes I suggest the following videos: https://www.hahn-tech.com/thinkorswim-autotrade-almost/ https://www.hahn-tech.com/thinkorswim-automated-round-trip-trades/
Marked as spam
|
Please log in to post questions.