palka
Download scriptThis script is a visual tool designed for the MetaTrader platform to provide a specific geometric reference on your trading charts. Rather than complex automated calculations, it serves as a structural overlay to help you visualize price relationships over a defined timeframe.
How it Works The logic of this tool centers on "connecting the dots" between two specific price points. It identifies the current closing price of the market and looks back at the closing price from a set number of candles ago (determined by the user-defined period).
Visual Behavior Instead of showing a continuous moving line or an average, the script draws a direct connecting section between these two points:
- The Start Point: The most recent market price.
- The End Point: The price recorded at the designated interval in the past.
Key Features for Traders
- Customizable Range: You can adjust the "Period" setting to choose how far back into the history you want the tool to reference. A shorter period will create a line that reacts quickly to recent movements, while a longer period will draw a line across a wider historical context.
- Visual Clarity: The indicator is rendered as a distinct magenta line, making it easy to see at a glance how the current price relates to its historical counterpart.
- Dynamic Updating: The script automatically refreshes with every new price tick, ensuring that the connection between the "now" and the "then" is always current on your screen.
In short, this tool acts as a visual anchor, allowing you to instantly see the trajectory from a specific past price point to the present moment.
//+------------------------------------------------------------------+
//| Palka.mq4 |
//+------------------------------------------------------------------+
#property copyright "© Maloma"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Magenta
extern int PPeriod=13;
double LineBuffer[];
int init()
{
SetIndexBuffer(0,LineBuffer);
SetIndexStyle(0,DRAW_SECTION,EMPTY,2);
SetIndexEmptyValue(0,0.0);
SetIndexLabel(0,"Line");
IndicatorShortName("Palka");
return(0);
}
int deinit()
{
return(0);
}
int start()
{
for(int i=Bars;i>=0;i--) LineBuffer[i]=0;
LineBuffer[0]=Close[0];
LineBuffer[PPeriod]=Close[PPeriod];
return(0);
}
//+------------------------------------------------------------------+
Comments