♥ 0 |
Hello, I have created a script that alerts for any stock price getting close to previous day’s close. it work as far as I ave tested. However when I convert it to study I cannot use it for Aggregate Period 5 min. I can only use for aggregate Period Day. The error I get is Secondary Period not allowed: Day Any help would be greatly appreciated code for Study def MarketOpenTime = 930; def SoundAlert = reachingClose and close[-1] <> reachingClose;
Marked as spam
|
Private answer
You have found that secondary aggregation periods are not supported for custom scans. The only way to work around this limitation is to re-write your code so that it no longer uses secondary aggregation periods. So while you thought you were asking how to convert a study to scan, the real issue is how to convert your code to no longer use secondary aggregation periods. The solution is quite complex. Since you posted your own code I will take that to mean you are trying to learn. So rather than provide the solution for you I will provide a link to a previous post that captures the previous day close without using a secondary aggregation period: https://www.hahn-tech.com/ans/stocks-crossing-above-previous-day-close-after-1030/
Marked as spam
|
Please log in to post questions.
"Converting Study to Scanner" is not the best title for this question. There are many examples of converting studies into scans in the Q&A forum. How is your's different? That's what your question title needs to include. Otherwise how are viewers supposed to understand that your post is different from all the others that have already been asked?
The other issue is that you posted you question in the wrong topic. You posted this in the "Frequently Asked Questions" topic when it should have been posted in the "Stock Scanners" topic. These details are important because your question is going to help the rest of our audience avoid this problem. But if you use the wrong title and post in the wrong topic you are helping no one.
I will fix all of those items before providing a solution. But doing so will break the URL link to this question. The new question title will be: "Secondary aggregation not allowed in scans". Which is the phrase you should have used when searching for this solution in the first place.