Scan ElliotOscillator histogram to select the highest peak of each wave over 70


  • Questions
  • Chart Studies
  • [RESOLVED] Scan ElliotOscillator histogram to select the highest peak of each wave over 70
Category:
0
0

Scan the Elliott wave oscillator in the TOS histogram to select the highest peak of each wave over 70, also place an arrow on the chart. thank you pete

RESOLVED
Marked as spam
Posted by (Questions: 5, Answers: 5)
Asked on March 31, 2020 5:42 am
99 views
Pete, sorry. Coronavirus is messing up my life. My mom lives in NEW JERSEY, she is a feisty 95 yr. Luckily or unluckily at this time, she will not sit still. If I am not there, from march 31 to last night, I presume she would have dead by now. She refuses to come home with me, so I had to stay with her every moment of every day. The problem was that I forgot my computer home, she does not have a laptop or tablet. I asked her to just come home with me so I could pick up my computer, she said NO, because I might keep her there, which I would have. So finally last night I came home, I asked my mom's neighbor to call me if she is TOO active outside. SO, bottom line, I am backed up with more important things right now that needs to be addressed. But I really appreciate your help and your response and your candid thoughts, which I will take into consideration. When I have a chance I will look over your response. And hopefully get back to you sooner than later. Again I appreciate your help.
( at June 8, 2020 9:01 am)
I totally understand. I have family in New Jersey as well and have been very concerned for their safety. I didn't have the means to get out there but have stayed in touch and they are doing very well. My mom lives only 35 miles from me but I haven't seen her since February under advice from my doctors. Both of us have medical issues that put as at higher risk than average. Best to play it safe until the doctors give us the green light. Thanks for sharing your story. Take care.
( at June 8, 2020 10:01 am)
0
Private answer

What you have requested is not a scan. I see from the attached PDF doc that you want to mark the peaks of the ElliotOscillator histogram, only when they exceed 70. This is not a scan. A scan is a true/false filter criteria that returns a list of stocks that match the filter criteria.

So you are asking for a chart study. The simplest solution would be to place a line on the ElliotOscillator at the value of 70. Then change the color of the plot for any values above that line.

This can be accomplished with very minor changes to the ElliotOscillator that comes with Thinkorswim. However the values are highly dependent on the price of the ticker symbol being charted. For example on a chart of MOS trading around $10 the histogram rarely goes above 0.7. But for a larger priced stock like AMZN trading around $1990 the histogram easily surpasses 40-50 range.

So your request is only going to fit the most narrow focus you could ever imagine. The value you select will be good for only a handful of ticker symbols. So the very basis of your request is a bit misguided. You really need to have some other method of identifying the peaks because using a fixed value for this chart study is very poor design.

However, here is the code that gets the job done:

input shortLength = 5;
input longLength = 35;
input peakLimit = 0.70;
def price = (high + low) / 2;
plot elliotOscillator = Average(price, shortLength) - Average(price, longLength);
plot zeroLine = 0;
plot limitLine = peakLimit;
elliotOscillator.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
elliotOscillator.SetLineWeight(3);
elliotOscillator.DefineColor("Positive", Color.UPTICK);
elliotOscillator.DefineColor("Negative", Color.DOWNTICK);
elliotOscillator.DefineColor("Peak", Color.MAGENTA);
elliotOscillator.AssignValueColor(if elliotOscillator > limitLine then elliotOscillator.Color("Peak") else if elliotOscillator > 0 then elliotOscillator.color("Positive") else elliotOscillator.color("Negative"));
zeroLine.SetDefaultColor(getColor(8));

Edit: In response to a request in the comment section below I will also provide an option to change the code to identify negative extremes. You can change one line of code to get it to perform the exact opposite as the original. Here is that line of code, modified to find extreme negative values. If you make this modification then you should use negative values for the user input named "peakLimit".

elliotOscillator.AssignValueColor(if elliotOscillator < limitLine then elliotOscillator.Color("Peak") else if elliotOscillator > 0 then elliotOscillator.color("Positive") else elliotOscillator.color("Negative"));

Marked as spam
Posted by (Questions: 39, Answers: 3710)
Answered on March 31, 2020 7:29 am
Pete, sorry I am just getting back to you now. My mom finally died, I had a lot of things to take care of. I just did not have the desire to do any thing. I made a few mistakes, because I was rushing to see my mom. Pete I really appreciate your help. I did try to run your coding, but it had mistakes in it and it failed. Plus you were correct, I used a bad example in my request BITCOIN, I should have used mos or even amzn like you suggested, because very few symbols go that high I requested at 70. SO, at this time if I may, can I request a modification to my request. So my objective is to scan for LONG positions but utilizing the negative waves to spot bottoms of up to -50. thank you
( at June 21, 2021 7:38 am)
Sorry to hear about your loss. I cannot even imagine what that like to go through that. Regarding your updated request. The code is not designed to find extreme negative values. It is only able to mark extreme positive levels. So you cannot simply adjust the user inputs to change the behavior. The code itself must be modified. The following line of code can be modified to reverse the behavior. Then you can set the user input named "peakLimit" to a minus 50: elliotOscillator.AssignValueColor(if elliotOscillator < limitLine then elliotOscillator.Color("Peak") else if elliotOscillator > 0 then elliotOscillator.color("Positive") else elliotOscillator.color("Negative") else elliotOscillator.color("Negative"));
( at June 21, 2021 11:30 am)
Pete , again thank you for your help. Here is the code you suggested I try. This also failed like I said in my previous request. elliotOscillator.AssignValueColor(if elliotOscillator < limitLine then elliotOscillator.Color("Peak") else if elliotOscillator > 0 then elliotOscillator.color("Positive") else elliotOscillator.color("Negative") else elliotOscillator.color("Negative"));
( at June 22, 2021 2:22 am)
I have updated my answer to correct the error in the code and provide an updated section to reverse the behavior of the color scheme.
( at June 22, 2021 7:20 am)
Sorry pete, It has been a horrible year, I have had 2 cousins die in the last couple of weeks, 3 in the last 9 months. Plus my mother died. None of these are covid related. I am still getting an error message after you change, sorry to bother you, but I appreciate it. NOT GETTING REQUEST FOR ATTACHMENTS, tried to put code here, getting error message over 1000 characters. So I am just putting the error message I got when after I made your changes. "EXPECTED ONE PLOT"
( at July 22, 2021 6:35 am)
Please re-read the details I provided along with my answer. Specifically, check the very first sentence: "What you have requested is not a scan". The only way you can receive the error message "expected one plot" is if you tried to apply this code as a custom scan. Since you did not specify any parameters that could define how this code should be used as a scan I am only able to provide code that functions as a chart study. All of this was explained in detail in my answer. I am sorry but I cannot afford to spend any more time trying to provide this solution for you in the Q&A Forum.
( at July 22, 2021 7:20 am)
pete I basterdize your macd scan to put together this scan, my objective is to replicate macd scan but use my code to scan ewo. I am willing to pay you for working modification. thank you input shortLength = 5; input longLength = 35; input consecutiveBars = 2; def price = (high + low) / 2; def elliotOsc = Average(price, shortLength) - Average(price, longLength); def redHistogram = elliotOsc < 0; plot scan = Lowest(elliotosc[1] < 0 and elliotosc[1] < elliotosc[2], consecutivebars) > 0 and elliotosc > elliotosc[1];
( at August 26, 2021 7:35 am)
I can't tell exactly what you are trying to achieve by looking at your code. But if you would like to pay for a professional solution you can get all the details on the following webpage: https://www.hahn-tech.com/about/
( at August 26, 2021 11:04 am)
pete, I can not afford $170, I have seen you offer packages at 35-40. your MACD histogram reversal after consecutive lower bars feb 2021 is what I am trying to replicate. but in lieu of macd hist I am trying to create a scan for ewo hist. My prior code is my attempt at that. thank you
( at August 27, 2021 1:52 am)
The current minimum charge is $190. I have never "offered packages at 35-40" so I have no idea what you are referring to there. You specifically requested a professional solution so I merely provided you the webpage where you can submit a custom project request. You are welcome to post this as a new question in this forum and if I can complete it within 15 minutes I will do so. There is no in between. I either provide a free solution for simple requests or I charge for complex requests that exceed that amount of time. Your request to convert this to work with ElliotOsclillator does not fit the context of this particular post. Each post in this forum contains one request and one or more solutions. A second request that is outside the original context of the question is not supported. I hope that clears up any remaining confusion.
( at August 27, 2021 7:10 am)