Indicator name >> TDI05 I would like to change the indicator provided in the attachment. It is a TDI indicator. Currently, the indicator is slow. It takes a long time to load on the chart. I wish the slowness of this indicator was removed. Then I want to delete all data except for the calculation of the row named "RSI Price Line". Following this, I want the indicator to compare the values ​​of this line to the price values ​​of the candles. The indicator should, with the calculations described below, show the divergence between these 2 values. Lines will need to be drawn. This indicator should not create slowdowns on my charts. Finally, alerts can be created. -------------------------------------------------- -------------------------------------------------- --------------------- To create alerts, this indicator will use - The values ​​of the TDI indicator - The price values - A calculated divergence between the price values ​​and the values ​​of the "RSI Price Line". - A level calculated on the TDI indicator - As well as a time filter -------------------------------------------------- -------------------------------------------------- --------------------- - Time filter First, we must be able to configure 1 period which will define the only time slot during which this indicator can create alerts and discrepancies. This filter will always be activated (on / off activation unnecessary). Only the hours should be able to be configured. By default, the start time will be 6:00 a.m. and the end time will be 8:00 p.m. Thus, the indicator will create discrepancies and alerts only between these 2 times. -------------------------------------------------- -------------------------------------------------- --------------------- - Modification of the TDI indicator Currently, the indicator is slow. It takes a long time to load on the chart. I wish the slowness of this indicator was removed. I'm not an expert, but I think maybe the slowdown is because the indicator is redoing calculations with each new tick. Currently, the TDI indicator creates multiple rows. I want to keep only one of these lines: the “RSI Price Line”. The calculation parameters for this row should be the same as those for the indicator I am providing. So if I compare the "RSI Price Line" line of the old indicator with that of the indicator you are going to create, the values ​​and the line plot should be the same. And as said before, the other lines of the current indicator will be of no use to me. I don't want them to appear on the chart. -------------------------------------------------- -------------------------------------------------- --------------------- - Calculation of divergence Several steps will have to be validated to create a divergence. -------------------------------------------------- -------------------------------------------------- --------------------- Step 001 First, on the "RSI Price Line" of the TDI indicator, you will need to identify points A and B. They will be identified as follows: If a (closing) level of the "RSI Price Line" is greater than its previous level and greater than its next level, then that level will be identified as an A point. If a (closing) level of the “RSI Price Line” is smaller than its previous level and smaller than its next level, then that level will be identified as a point B. -------------------------------------------------- -------------------------------------------------- --------------------- Step 002 The indicator should identify on the "RSI Price Line" a sequence of 3 successive points (A-B-A, or B-A-B) to start creating a divergence. For a bullish divergence: A point B followed by a point A followed by a point B. For a bearish divergence: Point A followed by point B followed by point A. -------------------------------------------------- -------------------------------------------------- --------------------- Step 003 To create a divergence, the indicator will have to compare the values ​​of "RSI Price Line" and the price of the corresponding candle. -------------------------------------------------- --------- - Normal divergences For a normal bullish divergence: -The value of the first point B must be lower than the value of the second point B -The lowest price value of the first candle B must be less than the lowest price value of the second candle B. For a normal bearish divergence: -The value of the first point A must be higher than the value of the second point A -The highest price value of the first candle A must be lower than the highest price value of the second candle A. -------------------------------------------------- --------- - Reversed divergences For a reverse bullish divergence: -The value of the first point B must be higher than the value of the second point B -The highest price value of the first candle B must be lower than the highest price value of the second candle B. For a reverse bearish divergence: -The value of the first point A must be lower than the value of the second point A -The highest price value of the first candle A must be higher than the highest price value of the second candle A. Normally, from my analysis, reverse divergence are very rare. So there will be very little on the graphics. -------------------------------------------------- --------- - As soon as these conditions are met, a discrepancy will be created, and an alert will be triggered (audible, visual, and on the alert panel). A trend line will be drawn between the 2 points B (bullish divergence). A trend line will also be drawn between the lower price value of the 2 B candles. A trend line will be drawn between the 2 points A (bearish divergence). A trend line will also be drawn between the higher price value of the 2 A candles. -------------------------------------------------- --------- -Authorization and invalidation zone for normal deviations The “RSI Price Line” values ​​in the B-A-B sequence will need to be below a certain level to allow a bullish alert. The "RSI Price Line" values ​​of the A-B-A sequence will need to be above a certain level to allow a bearish alert. The default value for this level is 75. For a bullish alert, this means that the values ​​of the "RSI Price Line" of the sequence B-A-B should be between 0 and 75. For a bearish alert, this means that the values ​​of the "RSI Price Line" of the sequence A-B-A should be between 25 and 100. -------------------------------------------------- --------- -Authorization and invalidation zone of reversed divergences The "RSI Price Line" values ​​of the B-A-B sequence will need to be above a certain level to allow a bullish alert. The "RSI Price Line" values ​​in the A-B-A sequence will need to be below a certain level to allow a bearish alert. The default value for this level is 40. For a bullish alert, this means that the values ​​of the "RSI Price Line" of the sequence B-A-B should be located between 60 and 100. For a bearish alert, this means that the values ​​of the "RSI Price Line" of the sequence A-B-A should be located between 0 and 40. -------------------------------------------------- -------------------------------------------------- --------------------- Step 004 - Purchase and sale alerts Following the creation of a divergence, validation of the following conditions may trigger a buy or sell alert. For a bullish buy alert The Closing Level of the "RSI Price Line" must close above the level of point A, of the sequence B-A-B which allowed to create the divergence. For a bullish buy alert, the arrow should be located under the next candle For a bearish buy alert The closing level of the "RSI Price Line" must close below the level of point B, of the sequence A-B-A which allowed to create the divergence. The alert arrow should appear when the following candle opens: For a bearish sell alert, the arrow should be located above the next candle -------------------------------------------------- --------- - Invalidation If the value of the "RSI Price Line" exceeds a certain level (details below), the created divergence can no longer create alerts. For a bullish divergence Closing level of the "RSI Price Line" below the previous B level, in the B-A-B sequence that created the divergence. For a bearish divergence Closing level of the “RSI Price Line” above the previous A level, of the A-B-A sequence that created the divergence. -------------------------------------------------- ---------- - Drawing of trend lines Trend lines should be drawn on the price chart and on the “RSI Price Line”. They should be drawn between: -the 2 points B for a bullish divergence (on the line "RSI Price Line"). -the 2 points A for a bearish divergence (on the line "RSI Price Line"). -------------------------------------------------- -------------------------------------------------- --------------------- - Color and sizes of alert arrows and drawn lines Normal bullish warning arrows should be: Blue, size 4 Normal bearish warning arrows should be: Yellow, size 4 Divergent bullish warning arrows should be: White, size 4 Divergent bearish warning arrows should be: White, size 4 The lines of bullish divergence should be: Blue, size 1, in dashed Bearish divergence lines should be: Yellow, size 1, dashed -------------------------------------------------- -------------------------------------------------- --------------------- - A history is requested -------------------------------------------------- -------------------------------------------------- --------------------- - Order of indicator parameters. I want the indicator settings to be positioned in this order, top to bottom. 1) Normal alerts (on / off) 2) Divergent alerts (on / off) 3) Authorization and invalidation zone (75 by default) 4) Purchase alerts (on / off) 5) Sales alerts (on / off) TDI indicator settings (Regarding these values, I don't know the exact parameters used to create this row). 6) Value used to configure the RSI Line 7) Value used to configure the RSI Line 8) Value used to configure the RSI Line Authorized alerts 9) Sound alerts (on / off) 10) Alerts for the creation of discrepancies (on / off) 11) Alerts to the alert panel (on / off) 12) The size of the history (1000 by default) 13) Start of the Time Filter (06H00) 14) End of the Time filter (8:00 p.m.) -------------------------------------------------- -------------------------------------------------- --------------------- If you need screenshots or some other explanation, please don't hesitate to ask me.