hi I’m trying to screen a range of Emas (20 to 65) which may meet my condition but my results are only Ema 65. how can I have all the Ema that meet my condition?
A 46-element (20 to 65) array would do the trick, but only 1 datum is allowed as a criterion.
A solution is to add all EMAs’periods as a single number so to get, say: 202532445165 for EMAs 20, 25, 32, 44, 51, 65
There are a couple of issues, though:
too many EMAs meeting the conditions would exceed the biggest number allowed (which I don’t know, maybe 15+ digits)
big numbers (such as dates in the format yyyymmdd) are usually reported in rounded scientific notation such as 20E+6 (or similar) which would make any coding effort vain.
I coded just [10] periods with SUMMATION, as I fear the 254-bar limit (unless you have the 1024-bar premium version provided by PRT direct) won’t allow much more more as EMAs require more than twice their periods to be calculated. So a 65-period EMA will require more than 130 bars + 100-lookback periods may exceed 254, but you can try more, say 20 or 40,…. even 100 could do (it’s not an easy accurate calculation).
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue