push5280 201 posts msg #156979 - Ignore push5280 |
6/12/2021 11:55:44 PM
I have an indicator that I'm trying to create however my code is not delivering the expected result, any help would be appreciated. I'm trying to find stocks that are within 20% of the 3 month high of my liquidity calculation. That is defined as: set{liquidity_guage50, close * average volume(50)}.
If I add the 3 month high and 3 month low it plots correctly:
Where the problem lies or where I get the unexpected result is when I try to find stocks that are within 20% of the liquidity_guage50 3 month high line. My code is returning 80% of the close. I don't know if it's my code or a Stockfetcher bug/feature.
|
xarlor 587 posts msg #156980 - Ignore xarlor |
6/13/2021 8:51:49 AM
You had some math errors mostly. Don't need to subtract high from low, then multiply by .8. Just need to multiply .8 by the high.
Also, SF sometimes doesn't like using "x day high" within a set statement, so have to give it its own variable first, then call it in.
Lastly, this has no bearing on the filter itself, but I kept messing up the variables since I was spelling gauge and you misspelled it "guage" so I changed them all.
|
push5280 201 posts msg #156983 - Ignore push5280 |
6/13/2021 4:04:16 PM
Thank you Xarlor! Exactly what I was looking for!
|