ThinkorSwim thinkscript – How to convert decimal to integer for VolumeAvg Script


  • Questions
  • Watch Lists
  • ThinkorSwim thinkscript - How to convert decimal to integer for VolumeAvg Script
Category:
0
0

i simply want to get rid of decimals in a column for watchlist or scan for volume avg.  I’ve been told there is no way to convert the following code to an integer other than to use an addlabel which would prevent it from sorting on that column.  Is there a solution to this?

plot volaverage = average(volume, 30);

Marked as spam
Posted by (Questions: 5, Answers: 1)
Asked on March 14, 2019 9:37 am
2666 views
0
Private answer

We can’t convert it directly to an integer. Thinkorswim does not use that data type. Everything in Thinkorswim is a double data type. If you can except a value of 100.234 being adjusted to 100.0 then we use the rounding function provided by Thinkorswim:

plot volaverage = Round(average(volume, 30), 0);

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on April 6, 2019 8:27 am