moving average loop

Forums ProRealTime English forum ProScreener support moving average loop

Viewing 4 posts - 1 through 4 (of 4 total)
  • #210925

    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?

    thanks

    #210929

    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.
    #210931

    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).

     

     

    #210958

    thank you Roberto but the period results are all like this:44 45 46 47 48 …

    some results are not quite accurate. when I write my previous code only for one Ema: say Ema34 all the results are accurate.

    but when using for loop, with same condition some of the results are off

     

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login