washington, D.C.
Posts: 22 since Jul 2018
Thanks Given: 0
Thanks Received: 11
|
I need help in writing a script function in thinkscript. Suppose I have the following code snippet and I want to write a function to call with relevant parameters. How do I do that. Here is the code snippet:
def down = low < low[1] && low[1] < low[2] && low[2] < low[3];
plot downPlot = down;
downPlot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
downPlot.setDefaultColor(Color.LIME);
downPlot.SetLineWeight(2);
AddChartBubble(downPlot, low - 0.25, "dn", Color.WHITE);
I want to write a function (e.g. signalPlot) that can take various parameters involved in plotting the signal down. I am specially interested in argument type declaration in the function. For example, how to define argument for “down” which is a boolean, color, line weight, and string type arguments.
|