ATP
Download scriptThis script is a custom technical analysis indicator designed for the MetaTrader 5 platform. Its primary purpose is to measure and visualize "Asymmetric Trend Pressure," which helps traders understand the underlying momentum of a market by weighing upward price movements against downward price movements differently.
Core Logic Overview
The indicator operates by scanning historical price data over a specific number of periods to determine how much "pressure" is being exerted in either direction. Unlike standard moving averages that simply smooth out price, this logic categorizes individual price candles into distinct types to calculate a net pressure value.
How the Calculation Works
To arrive at the final reading, the script performs the following steps:
-
Data Categorization: For every candle within a set window (the "Period"), the script checks if the closing price is higher or lower than the opening price.
- If the price closed higher, it is treated as Upward Pressure.
- If the price closed lower, it is treated as Downward Pressure.
-
Asymmetric Weighted Sums: The script does not treat all upward moves equally. It uses two different user-defined limits (Periods) to collect data:
- It sums up the price differences for a specific number of "Up" candles (e.g., the first 14 instances).
- It simultaneously sums up the price differences for a different number of "Down" candles (e.g., the first 10 instances).
- By using different limits for up and down moves, the indicator can highlight if one direction is more dominant or persistent than the other over a specific timeframe.
-
Net Pressure Calculation: After calculating the average intensity for both upward and downward pressure, the script subtracts the downward average from the upward average. The resulting figure represents the "Net Pressure."
Visual Output
The script provides three distinct visual components on the chart:
- ATP (Main Line): This is the primary indicator line. It shows the net balance of the trend pressure. A positive value suggests bullish pressure, while a negative value suggests bearish pressure.
- Up/Down Lines (Optional): Depending on your settings, you can choose to display separate lines for the individual upward and downward pressure components. This allows you to see the "raw" strength of each side before they are subtracted from one another.
Practical Use
Essentially, this tool allows a visitor to see the "tug-of-war" between buyers and sellers. By looking at the net pressure line, you can identify whether the current trend is being driven by strong, consistent moves or if the market is in a state of equilibrium where both sides are exerting equal force.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | A T P . m q 5 |
/ / | C o p y r i g h t 2 0 1 8 , M e t a Q u o t e s S o f t w a r e C o r p . |
/ / | h t t p s : / / m q l 5 . c o m |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
# p r o p e r t y c o p y r i g h t "