♥ 0 |
Hi I’m trying to create a ppo column so I can sort by it in the mobile phone app. Currently I have a column that says if all 3 are true then give me a 1 or if any are false then 0. I’m trying to get it so that if the shortest time frame is true then assign a value of 900 else 0, if the second time frame is true assign a value of 90 else 0, and the 3rd condition is true assign a value of 9 else 0. So if all 3 conditions are true 999 would be the plot This is the conditional value I have now but can’t get it to be the above. Thanks for any help you can provide! RESOLVED
Marked as spam
|
Private answer
Whenever you are working with custom chart studies it's important that you NOT try to reference the custom study in your code. Meaning that its best if you avoid using the Condition Wizard to build your solution. Why? It has been observed that referencing a custom study in the Condition Wizard has been shown to produce unreliable results in the past. It may work in most cases, but not all. So the safest thing is to always use the entire code in your solutions when a custom study is involved. For this solution I have embedded your code within a script structure. This allows us to reference the same set of computations multiple times while using a different set of inputs in each instance. This saves a lot of space and makes the code much easier to read and maintain. If you have not worked with script structures in Thinkorswim before I suggest you read up on them here: https://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/script Here is the code that you can drop into a custom watchlist column to produce the output you specified:
One final note about this solution. I have included your original conditions as comment lines in this code. This will help you match your original conditions to the new code structure I created to plot the values as you specified.
Marked as spam
|
Please log in to post questions.