Scan for stocks at 61.8% Fibonacci retracement 60m


Category:
0
0

Hi Pete,

I am trying to create  a scan in Thinkorswim that can find the stocks at 61.8% Fibonacci retracement level with time interval 20 days and aggregation period 60mn.

Thanks for everything  you do..!!

Zape

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on June 4, 2021 7:17 am
1103 views
0
Private answer

This is the simplest solution I can provide within the limited amount of time I allocate for each free solution I provide in the Q&A Forum. There are three inputs to adjust based on the amount of time you want to include, the Fibonacci level you want to target and the direction you want the Fibonacci structure to be applied. There are severe limitations to this approach but this is all can provide here in the Q&A Forum free of charge.

The first input set the number of bars. For a 60 min time frame we have 7 hourly bars for each regular session. Multiply this by 20 days and we get 140 bars. If you include extended hours trade data in the scan you will need to adjust this input but for stocks you will find it nearly impossible to get that value correct.

The second user input adjusts the Fibonacci level you want to target.

The third user input is where you tell the code whether to compute that 61.8% retracement from the low or the high. When set to "up" the code is computing the levels as if the low occurs before the high. When set to "down" the code is computing the levels as if the high occurs before the low. This is the biggest limitation for this solution but I do not have time to include logic that checks which occurred first and adjust things automatically.

The signal itself simply checks of any portion of the current candle it touching the Fibonacci target level. The code has no way to know whether you want this signal to find stocks crossing above or below this level. Once again this limitation is the result having to build the simplest possible solution. We can do more, but not free of charge.

input barsToInclude = 140;
input fibonacciLevel = 61.8;
input fibonacciDirection = {default up, down};
def targetHigh = Highest(high, barsToInclude);
def targetLow = Lowest(low, barsToInclude);
def range = targetHigh - targetLow;
def targetLevel = if fibonacciDirection == fibonacciDirection.up then
targetHigh - (range * fibonacciLevel * 0.01) else
targetLow + (range * fibonacciLevel * 0.01);
plot scan = high > targetLevel and low < targetLevel;

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on June 7, 2021 1:54 pm
0
Peter, I really appreciate you.. Thanks again for everything you do ..
( at June 7, 2021 2:05 pm)
0
Yep, glad I was able to mash something together for you. Plenty more can be achieved here. But not in the Q&A Forum.
( at June 7, 2021 2:13 pm)
0
Pete I am ready to do more with some fees. The scan is not what I am looking for.. Thanks
( at June 7, 2021 3:11 pm)
0
You can find details about the professional services we offer on the following webpage: https://www.hahn-tech.com/about/ Please take the time to read about our rates and terms of service listed on that page before filling out the contact form to submit your custom project request.
( at June 7, 2021 6:12 pm)