Attachments forums

List of attachments posted on this forum.


All files on forums: 135670

Re: MT4 Indicator requests and ideas

dmnik, Tue Dec 05, 2023 9:01 am

;)
Hello everyone! Dear programmers, I need your help! I need to fix the indicator; it is not working correctly. I tried to create it along with the GPT chat from the Pine script that I wrote myself. So, the Pine script turned out to be working, but for MT4, it does not work correctly. Please help me fix it. Thank you for your attention! Here is the description of the script and the script files.

This Pine Script indicator constructs upper and lower level lines based on the calculations of the Average True Range (ATR) and user-defined parameters. Let's break down the logic in detail:

Title and Settings:

//@version=5 - indicates the Pine Script version.
indicator(title="<<ATP Worm>>", overlay=true) - sets the indicator title and specifies that it will be displayed on top of the main chart.
Input Parameters:

pips - the number of pips used for calculations.
atrLength - the period for calculating the Average True Range (ATR).
multiple - the multiplier used for calculating monATR2.
Calculation of ATR:

monATR = ta.atr(atrLength) - calculates the ATR using the specified period.
monATR2 = ta.atr(atrLength) * multiple - calculates monATR2 by multiplying the ATR by the multiplier.
Calculation of Levels:

For upper levels (up1, up2, up3, up4), the current and previous low prices are used, along with the values of pips and monATR or monATR2.
For lower levels (dn1, dn2, dn3, dn4), the current and previous high prices are used, along with the values of pips and monATR or monATR2.
Displaying Levels:

The plot function is used to draw lines for upper (up3, up4) and lower (dn3, dn4) levels with specified colors and styles.
In summary, the indicator plots four support and resistance levels on the chart based on ATR and user-defined parameters pips, atrLength, and multiple. Line colors and other styles can be configured according to user preferences.
All files in topic