Watchlist column for unusual volume code

Aziat

New member
VIP
Good day. Can anyone help me with background color for watchlist indicator "unusual volume", code is below:

Code:
#Wizard input: price
#Wizard text: is at least
#Wizard input: percent
#Wizard text: %
#Wizard input: Choice
#Wizard text: than
#Wizard input: length
#Wizard text: bars ago


input price = volume;
input percent = 50;
input Choice = {default greater, less};
input length = 1;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}
 

BenTen

Administrative
Staff
VIP
Going to break it down into two separate columns because you have greater than and less than.

Greater than column

Code:
input price = volume;
input percent = 50;
#input Choice = {default greater, less};
input length = 1;

def x = 100*(price / price[length]-1);
plot data = x;
AssignBackgroundColor(if x >= percent then color.dark_green else color.gray);

Less than column

Code:
input price = volume;
input percent = 50;
#input Choice = {default greater, less};
input length = 1;

def x = 100*(price / price[length]-1);
plot data = x;
AssignBackgroundColor(if x <= -percent then color.dark_red else color.gray);
 

Andygray8

Member
VIP
Hi Ben, I've been using the unusual volume scanner. Thanks! Quick question, is there a way to set up a scan for stocks that have touched their lower bollinger band on the daily with let's say a 3 day look back? Been searching the forums and only found one with a close below. Thanks for all you do!
 

rad14733

Well-known member
VIP
Hi Ben, I've been using the unusual volume scanner. Thanks! Quick question, is there a way to set up a scan for stocks that have touched their lower bollinger band on the daily with let's say a 3 day look back? Been searching the forums and only found one with a close below. Thanks for all you do!
A 3 day lookback in what timeframe...??? Remember, lookbacks go by bars, not time itself... Therefore you would need to know how many bars back you need to look for that "touch" or crossover...
 

Aziat

New member
VIP
Hi Ben. Is it possible modify "unusual vol" for scanning ONLY post/pre-markets bar volumes. the idea is compare last and previous post/premarket volumes, and choose shares where is total volume for last bigger than volume on previous?

If this is impossible, may be just count post/pre-market bars, and compare last with previous post/pre-market?



Here is example, as we can see, on last post/premarket we have 5 bars, and only 3 bar on previous. So, is it possible to create scanner which will compare and choose shares where last post/premarket bars will more than on previous? 9:00 bar is not including to calculation
 
Last edited:

Similar threads

Top