"Second modification of my TREND indicator" -------------------------------------------------- -------------------------------------------------- ---------------- ""Description"" This indicator works very well. But I would like to make a modification concerning the conditions to be respected to create the alerts. Attached is the source code of the indicator I am currently using. -------------------------------------------------- -------------------------------------------------- ----------------- "Current operation of the indicator" Below I explain how the indicator works to create alerts. "The calculation candle" is the candle whose closing validates all the required conditions, and which creates the alert. - For a bullish alert Condition linked to the number of consecutive candles: If, between 2 bullish candles, there are at least 5 consecutive bearish candles (5 by default), an alert is created when the calculation candle closes. A bullish alert arrow is then created in the second window, under this calculation candle. Condition linked to the moving average: If the moving average value of the calculation candle is greater than the moving average value of the previous candle, the alert is allowed. If this condition linked to the moving average is not validated, the alert is not created. Condition related to bollinger bands: This condition only works if it is enabled in the indicator. If the value of the upper bollinger band is greater than the value of the previous candle's bollinger band, the alert is allowed. If this condition linked to Bollinger Bands is not validated, the alert is not created. - For a bearish alert Condition linked to the number of consecutive candles: If, between 2 bearish candles, there are at least 5 consecutive bullish candles (5 by default), an alert is created when the calculation candle closes. A bearish alert arrow is then created in the second window, under this calculation candle. Condition linked to the moving average: If the moving average value of the calculation candle is lower than the moving average value of the previous candle, the alert is allowed. If this condition linked to the moving average is not validated, the alert is not created. Condition related to bollinger bands: This condition only works if it is enabled in the indicator. If the value of the lower bollinger band is lower than the bollinger band value of the previous candle, the alert is allowed. If this condition linked to Bollinger Bands is not validated, the alert is not created. -------------------------------------------------- -------------------------------------------------- ----------------- "Condition to be added" I would like to add the following condition to authorize the creation of an alert. This condition will compare moving average values of multiple candles. The value of the number of candles to compare is 10 (default). The moving average value must be the same value as that defined in the indicator parameter called "MA Period". - For a bullish alert The previous 10 candles must have a moving average value greater than the moving average value of their previous candle. - For a bearish alert The previous 10 candles must have a moving average value lower than the moving average value of their previous candle. -------------------------------------------------- -------------------------------------------------- ----------------- "The new settings" There is only one new parameter line to add to the indicator. This is the “Number of Candles to Compare” line. It will allow you to define the number of candles preceding the alert candle which must respect this new condition. By default, its value should be 10. Finally, I want this parameter line to be placed just below the line called "Point Difference". -------------------------------------------------- -------------------------------------------------- ----------------- I have attached 2 screenshots to show you these conditions with images.