This ProBuilder code snippet demonstrates how to calculate the ratio of two moving averages and use this ratio to filter or screen data based on specified criteria.
mm3=average[3]
mm200=average[200]
ratio = mm3/mm200
test = ratio>=.97 and ratio<1
screener[test]
The code snippet provided performs the following operations:
mm3), and the second line calculates the moving average over the last 200 periods (mm200).ratio = mm3/mm200). This ratio measures how close the two averages are, relative to each other.test) where the ratio must be at least 0.97 but less than 1. This condition checks if the shorter moving average (3 periods) is within 97% to 100% of the longer moving average (200 periods), indicating proximity but not crossing or equaling.screener function to filter or screen data based on the test condition. This function will return data points where the condition is true.This example is useful for understanding how to manipulate and compare data series in ProBuilder, and how to use conditions to filter data effectively.
Check out this related content for more information:
https://www.prorealcode.com/topic/screener-mm200-mm3-croisement-proche/#post-145606
Visit Link