ds_Ticks

This tool is designed to provide a visual representation of price movement on your trading chart. Instead of showing the standard, jagged lines typical of raw market data, it creates a smoothed tracking effect by managing how historical and current prices are displayed.

How the Logic Works

Data Tracking and Memory The script maintains a dedicated memory "buffer" that holds a specific sequence of price points (set to 300 units). Think of this as a moving window that follows the market; as new information comes in, the script organizes it into a chronological list to keep track of where the price has been recently.

The Smoothing Mechanism The core logic operates by shifting existing data to make room for the newest update. Every time the market moves:

  1. The script takes the previous known price and carries it forward into the next slot of its memory.
  2. It repeats this process across the entire 300-unit sequence, effectively "pushing" the old data forward.
  3. Finally, it captures the very latest closing price of the current candle and places it at the starting point of this sequence.

Visual Output Because the script moves the data in this organized chain, it creates a continuous orange line on your chart. This allows you to see a steady flow of price action rather than isolated points. By shifting the values sequentially, the tool creates a visual bridge between past price levels and the current market reality.

Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
ds_Ticks
//=======================================================================================================================================================================
//	(c) 2009 DolSergon (dolsergon@yandex.ru/icq(qip)-366382375)
//=======================================================================================================================================================================
#property  copyright "(c) 2009 DolSergon"
#property  link      "http://tradecoder.narod.ru"

#property  indicator_chart_window
#property  indicator_buffers 1
#property  indicator_color1  Orange
#property  indicator_width1  1

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

int TicksCount = 300;
double	BufTicks[];
double	Ticks[];


//=======================================================================================================================================================================
int init()
  {
   IndicatorBuffers(1);
	ArrayResize(Ticks, TicksCount);
	ArrayInitialize(Ticks, EMPTY_VALUE);
   SetIndexBuffer(0, BufTicks);
   SetIndexStyle(0, DRAW_LINE);
   return(0);
}

  
//=======================================================================================================================================================================
void start() {
	for (int t=TicksCount; t>=1; t--) {
		if (t < TicksCount) {
			Ticks[t] = Ticks[t-1];
			BufTicks[t] = Ticks[t];
		} else    BufTicks[t] = EMPTY_VALUE;
	}
	Ticks[0] = Close[0];
	BufTicks[0] = Ticks[0];
   return;
}


Comments