Study that calculates a formula


New member
Hi there,
I believe this should be pretty straight forward for those that know Thinkscrip, but since I'm new to this language I would appreciate any help I can get.

I would like to create a study that calculates a formula based on closing prices in certain days, I then will use this in a scanner.
The study will not have any user inputs and will not plot anything.

The formula will be something along these lines:

3XClose(today) + 6XClose(10 days ago) + 10XClose(40 days ago)

Thanks a lot!


Well-known member
def c = close
plot x = (c * 3) + (c[10] * 6) + (c[40] * 10)

I think this is what you're asking for. Make sure the aggregation on the scan is daily.
What is the purpose of this? The result won't be scaled by how high the share price is