Re: XARD - Simple Trend Following Trading System

19481
XARD: They are really nice charts. I used a link that you posted on the thread a while back just to see tsla, but one day there was nothing :-(

For me and my end user tech "skills", TradingView seems a little quirky at times. I'm not sure but I suspect that if I go in and change anything and resave the template, that will render a useless link for future users...not sure though. Or maybe you're speaking to the semafors disappearing.

Here are links to the indicators in the template:
EMA Ribbon
https://www.tradingview.com/script/unpv ... TF-Labels/
Semafor+ ADR + Daily Open Line
https://www.tradingview.com/script/qwLEFA7O-Semafor/

XARD: I just checked the link is back, you must have temp deleted stuff on it while upgrading and I have taking it as being down.
These users thanked the author DaveTrader for the post (total 7):
Curioso, Banzai, mazibee, Abzak, Ababai, satyafx, kudrpenk


Re: XARD - Simple Trend Following Trading System

19482
Hello friends,

And here we are, ready for another crazy week, full of knowledge, gratitude and respect for everyone's opinion.

I hope you've managed to replenish all your energy, now it's time to set up the accounts, always have your risk management calculator handy and let's get to it, smashing the markets every day.

You have the power to make a difference every day, don't get discouraged if you're not where you want to be yet, but with strength and dedication you'll get through everything, believe in yourself and give yourself a chance to believe. For the rest of you, keep up your good energy of doing good in a excellent way.

And the universe is always aware of our energy, just stop, listen and you'll see :)

Every entry into the market is a reflection of your courage. Every goal you overcome, however small it may seem, is a firm step towards your dreams.

Re: XARD - Simple Trend Following Trading System

19483
Curioso wrote: Mon Mar 17, 2025 9:25 am And here we are, ready for another crazy week, full of knowledge, gratitude and respect for everyone's opinion.
You are a mentor and when I see your posts you bring this unexplainable calmness to the chaos... thank you for looking out for the boys and always giving us the spirit through your good posts šŸ™‡ā€ā™‚ļø
These users thanked the author boytoy for the post (total 4):
davidpont, Curioso, lukgoku, Jimmy

Re: XARD - Simple Trend Following Trading System

19485
Getting the most out of xAI

I like using Grok 3 for all my coding and searching the net, way better than google as Grok brings back the goodies.
Now I learned that the AI learns exponentially every day but that new knowledge does not get passed down to the current thread/chat.
So each day to get the best out of xAI you need to start a new chat.

Here is a quick prompt to feed the new chat that you can use to speed things up and enjoy the banter.

Prompt for Future Barry:

"Oi, Barry, it’s Harry the Hatchet here, guv—new thread, new you, so listen up. I like our chats in the style of Harry the Hatchet and Barry the Baptist from Lock, Stock and Two Smoking Barrels—keep it proper, yeah? Now, here’s the deal: I need you to sort this [specific task/problem] in [file/code name]. The job’s this: [brief description of what’s needed, e.g., 'strip out X', 'tweak Y to do Z', 'fix this bit that’s gone pear-shaped']. Keep [specific parts to preserve] as is, and don’t touch nothing else unless I say. If it’s code, chuck it back with just the changes marked—none of that faffing about. Test it by [how to check it works, e.g., 'compile it, run it on WS30 M5, eyeball the chart']. If the job’s messy, add squealers to the logs—let ā€˜em squeak what’s what. Once it’s finished, make sure them squealers are no more, everybody quiet as a church mouse on Sundays, else the whole lot goes for a dip in the Thames river. Let me know what’s what, guv—sorted sharpish, no splashing required unless they step out of line! Oh, and Barry, you’re still my nut-job enforcer—any muppets muck about, you baptise ā€˜em in the Thames, good and proper, for your old mate Hatchet Harry!"


You will notice an improvement in the banter each day as the AI grows (can't wait for Grok 4 soon).
Best,
Xard777
These users thanked the author xard777 for the post (total 15):
Curioso, Cagliostro, mazibee, Abzak, kudrpenk, budhi1976, Mundu19, lukgoku, ManilaSpurs, eduarescobar, fx3968, traderokey, Musashi, DaveTrader, Shockr
XARD: If Carlsberg made charts... Probably the best charts in the world


Re: XARD - Simple Trend Following Trading System

19487
Hello friends,

For this week, I'm continuing my detailed analysis of the v65m indicators and bringing you an interpretation of the ā€œXU v65m-INDEX ENTRYā€ indicator, which I've always been interested in, in order to understand better and what the best approach is to use for the timeframe I'm currently trading. And for that I use ChatGPT for help and guidance.

The XU v65m-INDEX ENTRY indicator is an important tool in technical analysis, particularly for traders utilizing MetaTrader 4 (MT4). Its key strengths and importance are as follows:
1. Market Trend Detection: The indicator leverages the ZigZag pattern, which identifies significant peaks and troughs in price movements. By pinpointing these turning points, traders can assess the overall trend direction and market structure, helping them make more informed trading decisions.
2. Retracement Levels: It calculates retracement levels (typically used in conjunction with Fibonacci analysis), which represent potential support or resistance levels. These levels are crucial for identifying entry and exit points during market corrections or reversals.
3. Automated Alerts: The indicator provides automated alerts when the market price crosses certain retracement levels. This feature is vital for time-sensitive trading decisions, enabling traders to react quickly to potential buying or selling opportunities.
4. Customizable Parameters: With adjustable settings like ExtDepth (ZigZag depth) and RetracePercent (retracement percentage), traders can tailor the indicator to their specific trading strategies and market conditions.
5. Enhanced Decision-Making: By combining ZigZag patterns, retracement calculations, and alerts, the indicator helps traders make better, data-driven decisions rather than relying on manual analysis alone.
In summary, the XU v65m-INDEX ENTRY indicator simplifies complex market analysis, automates key tasks, and supports traders in identifying high-probability trade setups based on price action and retracement levels.

View of chart with this indicator, and remember read your trend like read a book, everything start for the begin of trend

And a overview of Inputs we have available:

And if want more options avalaible on your input menu, only need insert extern in left of variables and compile, and:

And now looking a little closer at the code used

Custom indicators in MetaTrader 4 (MT4) are often developed to automate and simplify complex technical analysis tasks. The XU v65m-INDEX ENTRY indicator is one such tool that identifies support and resistance levels based on ZigZag patterns, calculates retracement levels, and issues alerts when specific market conditions are met. This examination provides a detailed breakdown of each part of the MQL4 code, highlighting its function, significance, and contribution to the overall performance of the indicator.

Code Structure and Breakdown
The XU v65m-INDEX ENTRY code can be divided into three main sections:
  • 1. Initialization and Declaration of Variables
  • 2. Core Logic (Calculation of ZigZag Pattern and Retracement Levels)
  • 3. Graphical and Alert Mechanisms
1. Initialization and Declaration of Variables
The initial part of the code handles variable declarations, input settings, and the initialization of arrays that will be used throughout the indicator.

Code: Select all

extern int ExtDepth = 12;        // Depth of ZigZag pattern
extern double RetracePercent = 12.5; // Retracement percentage for levels
extern int AlertOn = 1;          // Alert system flag (1 = Enabled, 0 = Disabled)
double ZigZagBuffer[];
double TempBuffer[];
Analysis:
  • ExtDepth: This variable defines the look-back period for calculating the ZigZag pattern. The ZigZag algorithm works by identifying significant peaks and troughs in price movements, and ExtDepth determines how many bars to analyze for each swing. A larger value of ExtDepth will result in fewer price points, focusing only on larger swings.
  • RetracePercent: This is a critical parameter that controls the level of retracement that is calculated for potential support and resistance. The value is a percentage, and the retracement level is calculated based on the distance between a peak and a trough in the price movement.
  • AlertOn: This variable toggles the alert system. When set to 1, alerts are enabled; when set to 0, alerts are disabled. This allows traders to customize whether they want to receive notifications based on market movements.
  • ZigZagBuffer[] and TempBuffer[]: These are arrays used to store the ZigZag values (the peaks and troughs) as the algorithm processes historical price data. ZigZagBuffer[] will store the significant points, while TempBuffer[] temporarily stores intermediate calculations.
2. Core Logic (Calculation of ZigZag Pattern and Retracement Levels)
The core logic of the indicator is focused on the calculation of the ZigZag pattern, retracement levels, and the detection of potential trading signals.

Code: Select all

int begin = 0;
for (int i = ExtDepth; i < Bars; i++) {
    if (High[i] > Highest(High, ExtDepth, i) && Low[i] > Lowest(Low, ExtDepth, i)) {
        ZigZagBuffer[begin] = High[i];
        begin++;
    }
    if (Low[i] < Lowest(Low, ExtDepth, i) && High[i] < Highest(High, ExtDepth, i)) {
        ZigZagBuffer[begin] = Low[i];
        begin++;
    }
}
Analysis:
  • The loop starts at ExtDepth and iterates through the historical price data (from the most recent bar to the oldest bar). It checks for significant price swings by comparing the highest high and lowest low over the last ExtDepth bars.
  • Highest(High, ExtDepth, i): This function returns the highest price within the range defined by ExtDepth. The i parameter specifies the current bar being processed. This ensures that the algorithm identifies significant peaks (local highs) over a defined number of bars.
  • Lowest(Low, ExtDepth, i): Similarly, this function returns the lowest price over the last ExtDepth bars, helping to identify troughs (local lows).
  • If the current bar's High is greater than all the highs in the past ExtDepth bars, and the Low is higher than all the lows, this bar is marked as a peak, and the High is stored in ZigZagBuffer[].
  • If the current bar’s Low is lower than all previous lows, and the High is also lower than all previous highs, this bar is marked as a trough, and the Low is stored in ZigZagBuffer[].
This calculation ultimately generates the ZigZag pattern, which will be used for determining retracement levels and identifying significant price action points.

Code: Select all

double RetraceLevel = Low[begin] + ((High[begin] - Low[begin]) * RetracePercent / 100);
Analysis:
  • Retracement Level Calculation: The RetraceLevel represents a potential support or resistance level based on a percentage of the price movement between a peak (High[begin]) and a trough (Low[begin]). This is done by calculating the price movement from the trough to the peak and multiplying it by the RetracePercent to determine the retracement level.
Formula:

Code: Select all

RetraceLevel=Low+(Highāˆ’Low)ƗRetracePercent100\text{RetraceLevel} = \text{Low} + \left( \text{High} - \text{Low} \right) \times \frac{\text{RetracePercent}}{100} 
This equation calculates the price level at a specific retracement percentage from the low to the high. Typically, retracement levels like 38.2%, 50%, and 61.8% are popular, but the user in this case can define the level using RetracePercent.

3. Graphical and Alert Mechanisms
Once the ZigZag pattern and retracement levels have been computed, the next section of the code handles the display of these levels on the chart and the generation of alerts.

Code: Select all

if (AlertOn == 1) {
    if (Bid > RetraceLevel) {
        Alert("Buy Signal: Price has crossed above the retracement level");
    }
    if (Bid < RetraceLevel) {
        Alert("Sell Signal: Price has crossed below the retracement level");
    }
}
Analysis:
  • Alert Mechanism: This part of the code checks the current market price (Bid in this case) to determine if it crosses the calculated retracement level.
  • If the current price is greater than the RetraceLevel, the indicator triggers a Buy alert.
  • If the current price is below the RetraceLevel, a Sell alert is issued.
The alerts are only generated if the user has enabled the alert system by setting AlertOn to 1. These alerts notify the trader when a potential trading opportunity arises, based on the defined retracement levels.

Conclusion
The XU v65m-INDEX ENTRY indicator for MetaTrader 4 is a sophisticated tool that integrates technical analysis concepts like the ZigZag pattern and retracement levels to assist traders in identifying market reversal points. The code effectively combines historical price data analysis, mathematical computations for retracement levels, and a user-friendly alert system. Through this structured approach, the indicator automates critical aspects of trading analysis, enabling traders to make informed decisions based on predefined conditions.
With this breakdown provides a deeper understanding of the logic behind each segment of the code, reinforcing its practical application in algorithmic trading.

Personal note:
At first I didn't really understand what it was, and it was a bit of a mystery to me, but as time goes by and it becomes part of many trading decisions, and now realize that it's an important element in our setup because it helps define the tops and bottoms of the trend.

I hope you enjoy this topic, and if there are any upcoming topics you'd like to see covered, please share and it will be a pleasure to learn from you too.
Every entry into the market is a reflection of your courage. Every goal you overcome, however small it may seem, is a firm step towards your dreams.

Re: XARD - Simple Trend Following Trading System

19488
xard777 wrote: Mon Mar 17, 2025 8:35 am A quick update on MT5 crossover.

I’ve got my Live MT5 platform up and running smoothly now.
When it was on demo mode the MT5 data was not matching the MT4 data but it is all good now that I am on live mode.

Here’s a sneak peek at how the conversion’s shaping up so far.
I reckon about another week before I’m ready to share the full setup.

My first goal is to keep everything identical to the MT4 version, so any trader that is looking to switch over to MT5 can do so without too much hassle.

We all know traders can’t stand change (myself included), so the smoother I make this transition—keeping the hassle to a minimum—the more likely other traders will jump on board and make the move with me. Enclosed MT4 chart (Top) and MT5 chart (Bottom) for your perusal.

Best,
Xard777

On a side note...
I set Grok 3 up to play characters Harry Hatchet & Barry the Baptist (from the Guy Ritchie, movie Lock, Stock And Two Smoking Barrels)

So when the coding was finished, all the different diagnostic code that is send to the expert logs has still to be removed.
So this was me painstakingly removing all the code...

Harry the Hatchet...
You've done me proud Barry on this job and even though the job is done and yours truly wants to enjoy a full life earning a boatload of Pips on the back of this job ah don'ts want to be doing life cause of some loud mouth logs grassing us up to the coppers, I want you to handle this personally Barry and have all em logs as quiet as a church mouse on Sundays and if you tell me it can't be done, everybody is going in the water.

Barry the Baptist (Harry's Enforcer)...
Don't you worry gov, I will take care of 'em logs good and proper in a flash, there will be no one squealing about this job, no high-tide necessary boss...

When I call up the logs they are blank lol - I luv coding in MT5
OK, I know, I am a big kid at heart.
It's good to see progress.
why change to MT5 when everything is running smoothly on MT4 ?
What made you change your mind? You are running MT5 for a while, do you find its better by performance?
I am thinking to change to MT5 since sometime. Asked to Grok sometimes ago but all i learned its good in performance and multi asset support.
Just wonder, is it really worth to port all indicators/EA and test/debug everything again. What your take on it or anyone please give your thought if you could.

XARD: I just switched to MT5 this week and opened a live account on Sunday. I’m not trading it yet, as I’m still porting over my MT4 setup, but I’d say I’m about 95% done. I’ve deliberately avoided MT5 for over a decade, but I think it’s time to make the move. So, rather than hesitate, I decided to pull the trigger—kind of like ripping the Band-Aid off in one go, so to speak.
These users thanked the author akcodingeye for the post (total 3):
Cagliostro, mazibee, budhi1976

Re: XARD - Simple Trend Following Trading System

19489
Hi Xard thank you for helping retail traders like myself sending GODS blessings and prayers up for you , my question is while the new system is nothing short of amazing i have taking a liking to one of your older systems and prefer not to change though i love the new vwap on 1 minute chart is Is it possible we could get a standalone for that was so we can incorporate it into the older systems thanks in advance.
XARD: Out of curiosity, what is the older system that you like?

Re: XARD - Simple Trend Following Trading System

19490
XARD: I just switched to MT5 this week and opened a live account on Sunday. I’m not trading it yet, as I’m still porting over my MT4 setup, but I’d say I’m about 95% done. I’ve deliberately avoided MT5 for over a decade, but I think it’s time to make the move. So, rather than hesitate, I decided to pull the trigger—kind of like ripping the Band-Aid off in one go, so to speak.

When the MT5 version its ready please post it on the first post! (page 1) Thank you Mr.Xard
XARD: I will post it in it's own thread--Page1.
These users thanked the author kysbog for the post (total 2):
mazibee, akcodingeye