The original title you selected for this question was far to vague so it has been updated to include the context of your request. Please consider this when posting questions in the future. "Custom column" is never going to be an acceptable title for any post in this forum.
While researching this I found some very odd behavior impacting the efficacy of the solution. So I will pass along what I found to help others to understand what to expect.
- When set to daily time frame, the column for "IsOptionable" shows the exact opposite status.
- When set to intraday time frame while excluding extended hours the "IsOptionable" column again shows the exact opposite status.
- The only way I was able to get it to work was to set it to intraday time frame AND check the box to include extended hours.
That behavior is utterly bizarre and makes no sense whatsoever. I am testing this during the post market period so perhaps this changes during regular market hours. When you apply this as a label to a chart it works just fine no matter what time frame you select. Which means the issues are related to a glitch or a bug within the custom column itself.
So, please be aware that we have some strange things taking place using this "IsOptionable" function within a custom watchlist column. Regardless of those issues, here is a solution which is properly formatted as you requested:
AddLabel (yes, + Round(volume *.000001 , 1) + “M”);
AssignBackgroundColor(if IsOptionable() then Color.BLUE else Color.CURRENT);