Re: XARD - Simple Trend Following Trading System

19323
Some reads...
These users thanked the author xard777 for the post (total 9):
Energybias, Curioso, mazibee, ManilaSpurs, lukgoku, budhi1976, Abzak, Zevia, MarVas
XARD: If Carlsberg made charts... Probably the best charts in the world

Re: XARD - Simple Trend Following Trading System

19325
Hello friends,

I hope you are being profitable and consistent every day with the new version (XU-20250224 Setup) of “XARD - Simple Trend Following Trading System”, but today the topic for a study and I hope to read your contributions on this indicator, and the version i decide to choose is XU v65m-PANEL1.mq4 . Because it's we have in open source and it's meant to help us better understand decision making, depend the timeframe we choose.

Some information is provided from ChatGPT.
Legend 1: This is what we look like overall with this indicator in our chart

A quick overview about the various points

Legend 2: Points we see on indicator

And now a explanation what is each value, to understand better this concept.
  • 1. Pair name:
In trading, a pair name refers to a currency pair in the forex market or a trading pair in other financial markets such as stocks, commodities, or cryptocurrencies.

For Forex (Foreign Exchange) Trading:
A currency pair is a combination of two currencies that are traded against each other. The first currency is called the base currency, and the second one is the quote currency.
  • 2. Current value of pair name:
This a actual value of your instrument available in your broker, and can be different in different platforms.
  • 3. spd:
SPD refers to the current market bid price (the price at which a trader can sell the asset) for the selected symbol (currency pair or asset). It is used to determine the speed or the value of the market price
  • 4. Countdown:
A countdown is a countdown sequence to indicate the time remaining until the current candle expires and a new one appears
  • 5. Where is the price in DailyOpen:
What is the value of price in this pair at the start of a new day
  • 6. Price from Open:
It seems like you're referring to "PFO," which stands for "Price From Open." This term is typically used in financial markets to describe a specific measure of price movement or performance starting from the opening price of a trading session.

In this context:

"Price from Open" refers to the price difference between a security’s opening price and its current or latest price during the trading day.
It can be used to analyze how much a stock or other asset has moved in a given time period from the point it opened.
For example:

If a stock opens at $100 and the current price is $105, the "PFO" would be $5.
Traders may use PFO as a metric to track the performance of the asset during the day.
This concept is often used by day traders, technical analysts, and investors to evaluate short-term movements. It provides insight into how an asset is performing relative to its starting point during the trading session.
  • 7. HiLo:
HiLo refers to the difference between the high and low prices of an asset over a specific period. In trading, it's commonly used to measure volatility or range.

For example:

Hi = Highest price during the period
Lo = Lowest price during the period
HiLo = Hi - Lo (the range)

This metric helps traders understand how much price movement occurred within the given timeframe.
  • 8. ADR:
The Average Daily Range (ADR) is a measure of the average difference between the highest and lowest prices of an asset over a specific number of days, typically calculated over 1, 5, 10, or 20 days.

It helps traders gauge volatility by showing how much the price of an asset typically moves within a day. A higher ADR indicates greater volatility, while a lower ADR suggests a more stable market.
  • 9. ADR in %:
The Average Daily Range in % (ADR%) is the Average Daily Range (ADR) expressed as a percentage of the asset's current price. This gives traders a relative measure of volatility in percentage terms, making it easier to compare the volatility of different assets or time periods.

And now we understand different aspects about information available, lets understand better all options we have to choose.
Let's go through the input parameters and other components of the provided MQL4 code for the custom indicator in detail:

1. Indicator Properties and Meta-Information

Code: Select all

#property link        "https://forex-station.com/post1294848283.html#p1294848283"
#property description "THIS IS A FREE INDICATOR WITH NO TIME RESTRICTIONS"
#property description "                                                      "
#property description "Welcome to the XARD UNIVERSE"
#property description "                                                      "
#property description "Let the light shine and illuminate your trading world"
#property description "and with it secure your financial prosperity"
#property indicator_chart_window
[*] `#property link`: Specifies the URL where the indicator can be found or additional details can be read.
[*] `#property description`: Multiple lines describing the purpose or branding of the indicator.
[*] `#property indicator_chart_window`: This property makes the indicator appear in the main chart window (not in a separate subwindow).


2. General Variable Declarations

Code: Select all

string Name = WindowExpertName(), MyName = "XU v65m-PANEL1";
string ID = "Xard";
[*] `Name`: This variable is assigned the name of the expert advisor or indicator that is being executed.
[*] `MyName`: Defines a unique name for the indicator, here "XU v65m-PANEL1".
[*] `ID`: A string used to identify the indicator within the code, set to `"Xard"`.


3. Chart Settings

Code: Select all

extern string STR01 = "<<<==== [01] Chart Settings ====>>>";
extern bool AutoArrangeChart = true, cleanChart = false;
extern color chartBackgroundColor = C'21,34,45', chartForegroundColor = clrDarkGray, chartGridColor = clrSnow,
             chartBarUpColor = clrRoyalBlue, chartBarDownColor = clrCrimson, chartBullCandleColor = clrRoyalBlue,
             chartBearCandleColor = clrCrimson, chartLineGraphColor = clrNONE, chartAskLineColor = clrDarkOrange,
             charttradeEntryColor = clrLimeGreen, charttradeLevelColor = clrOrangeRed;
extern double chartMODE = CHART_LINE;
[*] STR01 : A string to indicate the start of chart settings in the input interface.
[*] AutoArrangeChart : A boolean to specify whether the chart should be automatically arranged (i.e., chart colors, grid, etc.). Defaults to `true`.
[*] cleanChart : A boolean that controls whether the chart is cleaned (like removing previous objects or clutter). Defaults to `false`.
[*] chartBackgroundColor : Defines the background color of the chart (RGB value is C'21,34,45').
[*] chartForegroundColor : Defines the color of the foreground elements of the chart (set to dark gray).
[*] chartGridColor : Defines the color of the chart grid (set to snow).
[*] chartBarUpColor : Defines the color for upward bars/candlesticks (set to royal blue).
[*] chartBarDownColor : Defines the color for downward bars/candlesticks (set to crimson).
[*] chartBullCandleColor : Defines the color for bullish candles (set to royal blue).
[*] chartBearCandleColor : Defines the color for bearish candles (set to crimson).
[*] chartLineGraphColor : Defines the color for line graphs on the chart (set to none, meaning no line graph).
[*] chartAskLineColor : Defines the color of the ask line (set to dark orange).
[*] charttradeEntryColor : Defines the color of the entry level line (set to lime green).
[*] charttradeLevelColor : Defines the color of the trade level line (set to orange red).
[*] chartMODE : This sets the chart mode (here, it’s set to `CHART_LINE`, which is a line chart).

4. InfoBox Settings

Code: Select all

extern string STR02 = "<<<==== [02] InfoBox Settings ====>>>";
extern bool showINFOBOX = true;
extern color PanelBackColor = C'40,40,40', PanelForeColor = C'20,20,20', PanelBorderColor = clrSnow,
             Boxbgd = C'30,40,50', Panelcol = C'90,90,90', textcolUP = clrSnow,
             textcolDN = clrSnow, textcolWT = clrSnow, Panetpgd2 = C'40,50,60';
extern int PanelBorderWidth = 1, InfoBoxCorner = 1, Window = 0;
[*] STR02 : This string marks the start of the InfoBox settings section in the input interface.
[*] showINFOBOX : A boolean that specifies whether to display the InfoBox or not. Defaults to `true`.
[*] PanelBackColor : Defines the background color of the InfoBox panel (RGB value C'40,40,40').
[*] PanelForeColor : Defines the foreground (text) color of the InfoBox (RGB value C'20,20,20').
[*] PanelBorderColor : Defines the border color of the InfoBox (set to snow).
[*] Boxbgd : Defines the background color of the box inside the InfoBox (set to RGB value C'30,40,50').
[*] Panelcol : Color used for the panels (set to RGB value C'90,90,90').
[*] textcolUP, textcolDN, textcolWT : These control the colors of different text states (all set to `clrSnow`).
[*] Panetpgd2 : Background color for some elements within the InfoBox (set to RGB value C'40,50,60').
[*] PanelBorderWidth : The width of the border around the InfoBox panel.
[*] InfoBoxCorner : Specifies the corner radius of the InfoBox panel. (Likely to make it rounded if set to higher values.)
[*] Window : Used to select which window the indicator will be shown in (set to `0`).


5. Other Indicator Variables

Code: Select all

double DecNos, CLOSE, myPoint, mPoint, OpenToday, CloseToday, ADR1, ADR5, ADR10, ADR20, ADRavg;
double SetPoint() { if(Digits < 4) mPoint = 0.01; else mPoint = 0.0001; return(mPoint); }
double ADRpc;
[*] DecNos : The number of decimal places for the price.
[*] CLOSE : The close price of the instrument for today.
[*] myPoint : Used to determine the point size for a given instrument.
[*] mPoint : The minimum price change.
[*] OpenToday : The opening price of the instrument for today.
[*] CloseToday : The closing price of the instrument for today.
[*] ADR1, ADR5, ADR10, ADR20, ADRavg : These are used for Average Daily Range (ADR) calculations. They store the daily ranges for different periods (1 day, 5 days, 10 days, 20 days) and an average.
[*] ADRpc : Percentage of the ADR for current price movement.


6. OnInit Function (Initialization of the Indicator)

Code: Select all

int OnInit(){
    if(AutoArrangeChart) {
        ChartSetInteger(0, CHART_COLOR_BACKGROUND, chartBackgroundColor);
        // More code for setting chart properties like colors, grid, and chart modes.
    }
    IndicatorDigits(Digits); 
    IndicatorShortName(ID); 
    // Symbol-specific configurations for point sizes and decimal places.
    return(INIT_SUCCEEDED);
}
[*] AutoArrangeChart : If true, the chart is customized with the color settings provided earlier.
[*] IndicatorDigits(Digits) : Sets the number of digits (decimals) used for the chart.
[*] IndicatorShortName(ID) : Sets a short name for the indicator that is displayed in the indicator list.


7. OnCalculate Function (Main Logic of the Indicator)
The `OnCalculate` function is where the core logic for calculating values and displaying them on the chart occurs. It also interacts with the InfoBox and other visual components:
[*] It includes calculation of values like yesterday's high/low, current bid/ask, and daily open/close prices.
[*] The average daily range (ADR) and the percentage of movement compared to ADR are calculated and displayed.

8. Panel Display Functions

Code: Select all

void iPanel(string tls3, int x, int y, string Text, int fontSize, string Font, color Color) {
    ObjectCreate(tls3, OBJ_LABEL, Window, 0, 0);
    ObjectSet(tls3, OBJPROP_CORNER, InfoBoxCorner);
    // More object creation and settings for the InfoBox panel.
}

void Show_Timer() {
    // Logic to display a timer with the remaining time until the next candle.
}
[*] The `iPanel` function is used to create and configure the display of panels in the InfoBox (such as daily open price, ADR, market speed, etc.).
[*] The `Show_Timer` function is used to show the remaining time for the current candle/bar.


9. Clean-Up and Deletion

Code: Select all

void CleanUpOnAisle51() {
    int i;
    for(i = ObjectsTotal() [*] 1; i >= 0; i--) 
        if(StringFind(ObjectName(i), ID, 0) > -1) 
            ObjectDelete(ObjectName(i));
}
[*] This function is responsible for cleaning up the chart by deleting objects created by this indicator when the indicator is removed or deinitialized.

Conclusion
This code is a highly customizable charting indicator, designed to display several pieces of information about the current market state, including daily open/close prices, bid/ask values, Average Daily Range (ADR), and other market statistics. It provides a customizable InfoBox with configurable colors, fonts, and panel arrangements. The indicator also includes options to modify the chart's appearance and behavior based on the symbol or market being traded.

--

A personal opinion about this indicator

Whether you're taking your first steps in studying this strategy, or you're at a more advanced level, this indicator, like all the others, is important when making decisions about managing your positions.

Be smart, observe all the elements, if you're undecided, wait and watch and take your notes, because the pattern you're looking for has been repeating itself forever and will continue to do so, there's no need to complicate things, it's all there in front of you.

I hope you enjoy this post to help you better understand the importance of Panel 1 and I hope you all can contribute to growing together.
These users thanked the author Curioso for the post (total 8):
lukgoku, Cagliostro, mazibee, xard777, ODJ, Topguy7, Ababai, dienone
Stay strong and keep going! The journey isn’t easy, but each challenge makes you better.


Re: XARD - Simple Trend Following Trading System

19326
Curioso wrote: Fri Feb 28, 2025 7:31 pm Hello friends,

I hope you are being profitable and consistent every day with the new version (XU-20250224 Setup) of “XARD - Simple Trend Following Trading System”, but today the topic for a study and I hope to read your contributions on this indicator, and the version i decide to choose is XU v65m-PANEL1.mq4 . Because it's we have in open source and it's meant to help us better understand decision making, depend the timeframe we choose.
Mate, this is the most detailed post on a topic I have read in the entire forum!

This insight on Panel1 is really helpful to know about an underrated but very important tool, I think there is nothing so immediate and useful. Thank you Xard for your flashes of brilliance, thank you Curioso for your commitment and dedication to delving into key concepts.
These users thanked the author lukgoku for the post (total 4):
Curioso, mazibee, Topguy7, dienone
Yesterday is history, tomorrow is a mystery, but today is a gift, that’s why it’s called a Present! - Master Oogway


Who is online

Users browsing this forum: Ababai, Bing [Bot], Curioso, dienone, FXMann, lukgoku, Negas, TECHHDATE07 and 28 guests