Volume x percent above average within last x bars


Category:
0
0

#Wizard text: Current bar’s
#Wizard input: price
#Wizard input: choice
#Wizard text: at least
#Wizard input: percent
#Wizard text: % from its typical average over
#Wizard input: length
#Wizard text: periods

input price = volume;
input choice = {default increased, decreased};
input percent = 20;
input length = 50;
def avg = average(price, length)[1];
def chg = 100*(price/avg -1);
plot scan;

switch (choice) {
case increased:
scan = chg >= percent;
case decreased:
scan = chg <= -percent;
}

This the study I pulled from TOS scan it is unusual volume when current’s bar increased at least 1000% from it typical average over 20 period.

But I want to modified it to any bar that reached 1000% no only the current’s bar.

Thank you

Marked as spam
Posted by (Questions: 16, Answers: 12)
Asked on December 13, 2020 11:08 am
310 views
0
Private answer

I cannot even attempt a solution until you decipher the following sentence:

But I want to modified it to any bar that reached 1000% no only the current’s bar.

Seems there is as typo in there and it makes it impossible to comprehend.

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on December 13, 2020 2:09 pm
0
I have 20 period thatvi am watching so I want 1000% volume increase on any of the 20bars no only.the most recent one. Thanks
( at December 13, 2020 7:12 pm)
0
Thanks for attempting to explain this again. But even your new statement contains typos that can potentially change the meaning of the sentence. Slow down. Here is what I think you meant to describe: "Check the most recent 20 bars and see if any of those bars have a volume increase of 1000% or more". AND, for that comparison you want to compare the volume of each of those 20 bars to the 20 period simple moving average of volume. Do I understand you correctly now?
( at December 14, 2020 8:53 am)
0
Exactly Peter I don't know how I could word it better.....
( at December 14, 2020 9:58 am)
0
Private answer

We now have a clear description of the request (see comments section below the original answer I provided on Dec 13th). I have updated the title of the question to describe the request more clearly. For those viewers searching for a similar solution, this will help them find this post much faster.

The solution begins by using the Condition Wizard and ends with a slight modification to the code the Condition Wizard generates. I am using this previous post as the foundation for this method of building scans:

https://www.hahn-tech.com/ans/volume-greater-than-50-period-volumeavg-times-2/

Be sure to take some time to view the video linked in my answer to that question. It will explain how to use the Condition Wizard to build advanced custom scans without knowing anything about writing code.

Screenshots below show the specific steps required to build this scan.

(when you multiply the average volume times 10 it is the same as saying "1000% greater than average volume).

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on December 14, 2020 12:07 pm