Attachments forums

List of attachments posted on this forum.


All files on forums: 135675

Re: MT4 Indicator requests and ideas

dmnik, Tue Oct 24, 2023 4:42 am

Dear programmers, hello! Could you please convert my build to MT4. Thank you !

This Pine Script is an indicator for TradingView that performs several functions, including creating a dynamic fan of lines based on Hull Moving Averages (HMA), generating buy and sell signals, and calculating and displaying levels of support and resistance. Below is a detailed logical description of how the script works:

Indicator Initialization:

The script starts with indicator initialization, defining its name, title, and other settings.
Input parameters for the number of lines, their colors, and moving average lengths are defined.
Hull Moving Averages (HMA):

The script calculates two Hull Moving Averages (HMA) based on the closing price with different periods (5 and 20).
These HMA lines are then plotted on the chart and colored based on user-defined colors.
A fill is used to highlight the area between the two HMA lines.
Dynamic Fan of Lines:

The script creates a dynamic fan of lines on each bar. Each line starts at a specified point and extends based on the difference between the open and close prices over a defined number of bars (fiu_time).
These lines are color-coded based on whether they are pointing up or down.
The starting and ending points of each line are calculated and extended into the future to provide a visual representation of the fan.
Buy and Sell Signals:

Buy and sell signals are generated based on the crossover and crossunder of the two Hull Moving Averages (HMA). When the faster HMA crosses above the slower one, a buy signal is generated. Conversely, when the faster HMA crosses below the slower one, a sell signal is generated.
These signals are marked on the chart using arrow shapes.
Custom Functions:

The script defines two custom functions (f1 and f2) which seem to be related to certain calculations. Their exact purpose is not described in the code.
Moving Averages and Levels:

Additional moving averages and levels are calculated and displayed on the chart. These include Simple Moving Averages (SMA) and support/resistance levels.
The levels are represented by lines with specific colors.
Block and Line Drawings:

The script defines settings for drawing boxes and lines on the chart based on specific conditions.
These drawings are intended to represent levels of support and resistance and are color-coded.
Point and Draw Management:

The script manages points and drawings on the chart, including checking for certain conditions and updating them accordingly.
Volume Calculation:

The script calculates the volume associated with certain conditions (e.g., reaching a support or resistance level) and records it.
Level Overlapping:

The script checks for overlapping levels and adjusts them if necessary.
Display of Support and Resistance Levels:

The script defines settings for creating and displaying support and resistance levels on the chart.
These levels are updated on each candle, and their coordinates are adjusted as the chart progresses.
User-Defined Parameters:

The script provides user-defined parameters for specifying the number of blocks, the number of consecutive candles for support and resistance calculations, the data source (close, open, or high), and options to hide volume.
Display and Styling:

The script allows users to customize the visual appearance of the support and resistance levels, including their colors and text settings.
Final Output:

The script generates a final output on the chart, displaying "DN" (presumably representing "Down") at the bottom-right corner of the chart as a label with a specific color and text size.
Please note that this script is quite complex and may have been designed for a specific trading strategy. Understanding and modifying it for specific trading needs would require a deep understanding of Pine Script.
All files in topic