# How do i add a minimum value in this code?

#### tempestlight

##### New member
Hi there, i have this as a column in my scanner but i was wondering if i could add say an in if statement that would only provide results that are over \$500,000? Is that possible to add this to this script? I just have the free ToS so i'm restricted in some senses. Thanks!

def A = hl2;
def highestvolofday = highestall(if GetLastDay() == GetDay() and highestall(volume) then (volume) else double.nan);
def High_vol_Price = if volume == highestvolofday then A else High_vol_Price[1];
Plot scan = (High_vol_Price*100) * highestvolofday;

This doesn't work but wondering if anyone has a workaround.

def A = hl2;
def highestvolofday = highestall(if GetLastDay() == GetDay() and highestall(volume) then (volume) else double.nan);
def High_vol_Price = if volume == highestvolofday then A else High_vol_Price[1];
Plot scan = if(((High_vol_Price*100) * highestvolofday)>500000);

Last edited:
@tempestlight The if is unnecessary.
Code:
``Plot scan = (High_vol_Price * 100 * highestvolofday) > 500000;``

@tempestlight The if is unnecessary.
Code:
``Plot scan = (High_vol_Price * 100 * highestvolofday) > 500000;``

This only displays "1" or "0" for some reason and not the calculated value

@tempestlight Isn't this for a scan? The scanner will look for 1 or 0. If you want it to show the actual value then remove the > 500000.

@tempestlight Isn't this for a scan? The scanner will look for 1 or 0. If you want it to show the actual value then remove the > 500000.

Yes it's for a scan but currently with my original script it's displaying for example \$100,000, \$165,000, \$600,000, etc. I want it to just show anything over \$500,000 and if it is below, don't show anything.

Something like this?
Code:
``plot scan = if High_vol_Price * 100 * highestvolofday > 500000 then High_vol_Price * 100 * highestvolofday else double.nan ;``

Something like this?
Code:
``plot scan = if High_vol_Price * 100 * highestvolofday > 500000 then High_vol_Price * 100 * highestvolofday else double.nan ;``
Yes sort of. Is there a way to just completely remove these NaN results from the search to avoid clutter?

I have no idea what the NaN results are but if you want to scan then use post #2.

87k+ Posts
276 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?