Okay, so our goal is to take a plotted value from a custom script and repurpose it for Stock Scanning. In this example we’ll begin with the code used for plotting Dollar Volume ( Plotted in Millions ) from our Resources page. All the code required for this tutorial will be pasted below.

As is, the script currently has extra bits of code for plotting values beneath a chart. For simplicity, we’ll reduce the code to it’s most basic components.

input offset = .000001;

plot million = Round(((volume * close) * offset),2);

Note the offset value. What this does is offset our decimal place over 6 zeros so that $1 Million == 1 in Dollar Volume, and $1 Billion == 1,000. We calculate dollar volume by multiplying volume * close followed by the offset.  Then we enclose the calculation by applying the Round(a,b)function. Were a represents the calculation, and b represents the decimal place to which you would like to round. When trading Large and Mega Cap stocks it can be beneficial to alter your unit of measurement to accommodate larger values. However, if you are instead using this for Small & Micro Cap Stocks, you may want to consider changing the offset value to a 1 for more granularity.

The First Part

1. Go to Chart Tab

2. Click on Studies

3. Scroll down to Edit Studies

4. Click Create from the bottom left

5. Delete NewStudy0 title and rename to DollarVolume, Millions, or whatever you’d prefer.

6. Paste the following code

input offset = .000001;

plot million = Round(((volume * close) * offset),2);

7. Click Ok and the window should close.

8. Tap Apply on the next page.

9. Optional- You can actually delete Dollar Volume from this screen by clicking the ‘X’ besides the Gear Icon. This screen is just for plotting scripts. But remember we cut out all the fancy stuff for plotting so as it is, these two lines of code aren’t enough to display anything on the chart. You’d have to use the full script as it’s posted on the Resources page for it to display properly.

The 2nd Part

10. Go to the Scan Tab-> Stock Hacker

11. Click Add Study Filter

12. Click the Pencil Icon at the far right

13. Delete ADX Crossover or whatever appears.

14. Click Add Condition

15. In the Select a Condition Drop Down select -> Study

16. Type in Dollar Volume or whatever you named it earlier. Select the Study.

17. A Menu should appear on the right.

18. From here you can select any parameters you’d like. As an example I’ll select -> Is Greater Than

19. On the right there’s another Condition Drop Down. Select -> Value 20. It should default to 100 i.e $100,000,000.

20. Click Save. Note at at the top there is a large ‘D’ as in Daily. You can click on this and edit the time frame you’d to scan for.

And that should be it. I know the standard process for using custom scripts in your scanner is a bit lengthy. But with time, I assure you, this process will become second nature as you become familiar with it! Let me know if this works for you!

Share This!

Share this page with your friends!