♥ 0 |
Pete: I came cross a confusing def statement in the source code of DarvasBox, a TOS study . First line def defines “state” with a few alternatives The second line merely indiactes variable names “upper” and “lower” in the statement without assigning anything and the third def statement already uses the prior bar values of upper and lower which were not assigned to anything so far. Is it possible to help me understand how these work and what they are doing. Thanks SourceCode DarvasBox Study def state = {default state_1, state_2, state_3, state_4, state_5}; def upper; def prevLower = CompoundValue(1, lower[1], low); …. Thanks Arun Rao
Marked as spam
|
Private answer
You left out all the important parts. This is a very advanced technique used in several studies in Thinkorswim.
That is what’s termed “an enumerated variable”. I didn’t find an example in Thinkorswim’s language reference but I did find an example using an “enumerated input”: http://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/input/enum.html The values for:
Are assigned within the switch/case statement. The switch/case statement reads and sets the value of the enumerated variable “state”. Read more about the switch/case statement here: http://toslc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/switch.html If this explanation left you more confused than when you started than just drop it for now. This is far to complex a topic to fully explain in the Q&A forum. Marked as spam
|
Please log in to post questions.
Thanks Pete. I will follow the links you provided above and see if I can understand.