Re: Trend Indicators for MT4

1762
MakarFX wrote: Tue Feb 11, 2025 9:01 pm Dear friend. I can't use this indicator in the advisor as a resource.
I get the error:

2025.02.11 11:57:10.533 2025.01.27 06:00:00 ! optimized trend tracker.ex4 XAUUSD,H1: Alert: You are trying to use renamed or wrapped indicator
2025.02.11 11:57:10.533 2025.01.27 06:00:00 ! optimized trend tracker.ex4 XAUUSD,H1: Alert: The file name must be : ! optimized trend tracker.ex4

This is my code:
#define ind_name "Indicators\\! optimized trend tracker.ex4"
#resource "\\"+ind_name

Please help.
Looks like the o should be capitalized, like this ! Optimized trend tracker Not sure why it is telling you wrong in its response.!

Re: Trend Indicators for MT4

1764
MakarFX wrote: Wed Feb 12, 2025 2:59 am There may be a name check inside.
But the expert gives a different name when compiling the resource.

Please show the source code of "OnInit()"
Yes, I added a name check, almost always do!

Code: Select all

int OnInit()
{
   IndicatorBuffers(6);
   SetIndexBuffer(0,val,  INDICATOR_DATA); SetIndexStyle(0, DRAW_LINE,EMPTY,inpLinesWidth,inpColorNu);
   SetIndexBuffer(1,valUa,INDICATOR_DATA); SetIndexStyle(1, DRAW_LINE,EMPTY,inpLinesWidth,inpColorUp);
   SetIndexBuffer(2,valUb,INDICATOR_DATA); SetIndexStyle(2, DRAW_LINE,EMPTY,inpLinesWidth,inpColorUp);
   SetIndexBuffer(3,valDa,INDICATOR_DATA); SetIndexStyle(3, DRAW_LINE,EMPTY,inpLinesWidth,inpColorDn);
   SetIndexBuffer(4,valDb,INDICATOR_DATA); SetIndexStyle(4, DRAW_LINE,EMPTY,inpLinesWidth,inpColorDn);
   SetIndexBuffer(5,valc,INDICATOR_CALCULATIONS);
   
   glo.mPer = fmax(inpMaLength,1);
         
   IndicatorSetString(INDICATOR_SHORTNAME,"Optimized trend tracker ("+(string)inpMaLength+")");
   if (!checkName()) return(INIT_FAILED);
return(INIT_SUCCEEDED);
}


Re: Trend Indicators for MT4

1766
Trend Correlation Strength (TCS) Indicator

Introducing the Trend Correlation Strength (TCS) Indicator

A new forex indicator called the Trend Correlation Strength (TCS), designed to measure trend strength in a unique and effective way, surpassing traditional indicators like the Average Directional Index (ADX). Unlike the ADX, which relies on directional movement (+DI and -DI), the TCS uses a fresh approach by calculating the correlation between closing prices and a linear time series, offering forex traders a distinctive tool for identifying strong trends.

Why You Need TrendCorrelationStrength
Imagine a forex market where trends sneak up like whispers before roaring into multi-month moves—hundreds of pips just waiting to be captured. You’ve got your indicator toolkit, but something’s been missing: a way to pinpoint strong trends with precision, cutting through the noise of weekly volatility. Enter TrendCorrelationStrength (TCS)—your secret weapon, built from the ground up to outshine the old guard like ADX.

Why It’s a Must-Have
Catches Trends Like a Pro:
TCS doesn’t mess around with lagging directional averages—it measures how linearly prices move over time, spotting trends as they build. Think of it as a trend radar: when TCS climbs above 45 on your weekly chart, it’s screaming, “This move’s got legs!” Pair it with a few decent indicators, and you’re in early—grabbing pips while others are still guessing.
Simple, Clever, Yours:
“simple and clever”—TCS delivers. One blue line, no clutter, with a dotted 45-level guide baked in. It’s your strength signal, your volume proxy, all in a clean package—perfect for your algo’s elegance. No +DI/-DI nonsense—just pure trend power.
Forex-Tuned Edge:
Unlike ADX, born for 1970s commodities, TCS is forged for forex’s macro-driven world. Those 13 weeks? That’s a quarter—think GDP releases, rate hikes—tailored to the rhythms you trade. It’s not a relic; it’s your modern advantage.

Why TCS Stands Out
Unique Calculation: It measures how linearly prices move over time, a perspective not captured by the ADX or other common indicators.
Trend Strength Focus: Like the ADX, it quantifies trend strength on a 0–100 scale, but it does so through price-time correlation.
Responsiveness: Detects trends quickly in linearly trending markets, potentially giving traders an edge.
Simplicity: A single, easy-to-read line makes it accessible for traders of all levels.

How TCS Works
The TCS indicator calculates trend strength in two steps: computing a raw trend strength value based on correlation, then smoothing it to reduce noise.

Step 1: Correlation Calculation
What It Measures: For each bar, TCS calculates the Pearson correlation coefficient (( r )) between the closing prices of the last ( M ) periods and a linear time series (e.g., 1, 2, 3, ..., ( M )).
Scaling: The absolute value of ( r ) (ranging from 0 to 1) is multiplied by 100 to produce a raw TCS value between 0 and 100. The absolute value ensures the indicator reflects trend strength regardless of direction (up or down).

Step 2: Smoothing
Method: The raw TCS is smoothed using Wilder’s smoothing technique, similar to the ADX, to make it less sensitive to minor price fluctuations.
Strong Trends: In a steady uptrend (e.g., prices rising from 100 to 114 over 14 periods), the correlation approaches 1, yielding a raw TCS near 100. Similarly, a downtrend produces a high TCS due to the absolute value.
Ranging Markets: In choppy conditions (e.g., prices oscillating between 100 and 101), the correlation nears 0, resulting in a low TCS.
Smoothing Effect: The smoothed TCS provides a stable signal, helping traders avoid false positives in volatile markets.
Advantages Over Existing Indicators
Novel Insight: By focusing on price-time linearity, TCS captures trends differently from momentum-based (e.g., RSI) or direction-based (e.g., ADX) indicators.
Potential Edge: It may detect linear trends earlier or more reliably than the ADX in certain market conditions.
Complementary Use: Since TCS is directionless (like the ADX), it pairs well with directional tools like moving averages or Ichimoku Cloud.

Limitations
Linear Assumption: TCS excels with linear trends but may underperform with parabolic or erratic price movements.
No Direction: It indicates strength, not direction, requiring additional indicators for trade decisions.
These users thanked the author SEC7 for the post (total 11):
Akela, Kayleb, smkale123, mrtools, Krunal Gajjar, Jimmy, boytoy, andrei-1, Sutatong, timballingall67, global

Re: Trend Indicators for MT4

1769
SEC7 wrote: Sat Feb 22, 2025 12:29 pm Introducing the Trend Correlation Strength (TCS) Indicator
Trend Correlation Strength (TCS) Indicator with EMA Smoothing

Hope you don't mind did this version with ema smoothing.

For the full description of this code, please see SEC7's post: Trend Correlation Strength (TCS) Indicator - Modern ADX for Forex.
These users thanked the author mrtools for the post (total 13):
vinuthbn84, Kayleb, ionone, Jimmy, boytoy, andrei-1, macd & rsi, RodrigoRT7, Sutatong, SEC7, kvak, timballingall67, global

Re: Trend Indicators for MT4

1770
SEC7 wrote: Sat Feb 22, 2025 12:29 pm Trend Correlation Strength (TCS) Indicator
I think this is fantastic.. indeed a modern day directional ADX for erratic markets.. i have set smoothing back to nothing (1 period) then inserted a 5 period moving average into it's window and set it to "Previous indicators data" as an additional filter.. I love how you made the code in mql4 and open! I think you have just gifted traders with a potentially game changing indicator and I know Jeff (ionone) will gravitate towards this code too ahaha
mrtools wrote: Sun Feb 23, 2025 5:32 pm Trend Correlation Strength (TCS) Indicator with EMA Smoothing
Mrtools superb addition to it thank you for adding new functions for us (already!) I just think you forgot to let us change level coloring, seems hard coded on grey
These users thanked the author boytoy for the post:
andrei-1


Who is online

Users browsing this forum: JMachine, Lwqa and 27 guests