Ticker SATL

Download script
Author: mandorr@gmail.com
Ticker SATL

This script is a custom technical indicator designed for the MetaTrader 4 platform to track and visualize specific price movements in a dedicated sub-window. It focuses on processing "ticks"—the smallest possible price changes—rather than standard time-based candles.

Core Functionality

The logic operates by monitoring the real-time bid price of a financial instrument. Instead of reacting to every single micro-movement, the script identifies unique price levels. Whenever the price shifts significantly enough to be rounded to the nearest point, the script captures that value and stores it in a historical sequence.

Data Processing & Logic

  1. Tick Tracking: The tool maintains a chronological list of these price points (referred to as "tickers"). As new prices arrive, the script pushes them into a buffer, effectively creating a memory of recent price action.
  2. The SATL Calculation: The primary purpose of this script is to calculate a specific weighted value called "SATL."
  3. Weighting System: Rather than taking a simple average, the SATL value is calculated using a complex mathematical formula. It takes the last 65 price points and multiplies each one by a unique, specific coefficient (a weight).
    • Some prices are multiplied by positive numbers (adding to the total).
    • Other prices are multiplied by negative numbers (subtracting from the total).
  4. Activation Delay: The SATL line does not appear immediately. The logic is programmed to wait until at least 65 price changes have occurred. This ensures that the mathematical formula has enough historical data to generate a valid result.

Visual Representation

The indicator provides two distinct visual components in its window:

  • Ticker: A representation of the raw price movement over the sequence of ticks.
  • SATL Line: A secondary line representing the calculated weighted value based on the 65-tick logic described above.

As new price data arrives, both lines update dynamically, allowing you to see the relationship between the raw tick history and the specialized SATL calculation in real-time.

10 Views
0 Downloads
0 Favorites
Ticker SATL
// Ticker SATL.mq4
// Èíäèêàòîð
// Ëèíèÿ SATL íà÷èíàåò ðèñîâàòüñÿ ñ 65 òèêà

#property copyright "mandorr@gmail.com"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Gray
#property indicator_color2 Gray
#property indicator_width1 1
#property indicator_width2 2
#property indicator_style1 0
#property indicator_style2 0

extern int BarsCount=1000; // Êîëè÷åñòâî îòîáðàæàåìûõ áàðîâ

int count;
int price;
int price_prev;

double ticker[]; // áóôåð òèêîâ
double SATL[];   // áóôåð SATL
double buffer0[];
double buffer1[];

void init() {
   SetIndexBuffer(0,buffer0);
   SetIndexBuffer(1,buffer1);
   SetIndexLabel(0,"Ticker");
   SetIndexLabel(1,"SATL");
   SetIndexDrawBegin(0,0);
   SetIndexDrawBegin(1,0);
   SetIndexEmptyValue(0,0.0);
   SetIndexEmptyValue(1,0.0);
   ArrayResize(ticker,BarsCount);
   ArrayResize(SATL,BarsCount);
   for (int i=0; i<BarsCount; i++) {
      ticker[i]=0.0;
      SATL[i]=0.0;
      buffer0[i]=0.0;
      buffer1[i]=0.0;
   }
   buffer0[BarsCount]=0.0;
   buffer1[BarsCount]=0.0;
   count=0;
   price_prev=0;
}

void start() {
   int i, j;
   double sum, value;
   price=MathRound(Bid/Point);
   if (price==0) {return;}
   if (price==price_prev) {return;}
   price_prev=price;
   count++;
   for (i=BarsCount-1; i>0; i--) {
      ticker[i]=ticker[i-1];
      SATL[i]=SATL[i-1];
   }
   ticker[0]=price*Point;
   // Ëèíèÿ SATL íà÷èíàåò ðèñîâàòüñÿ ñ 65 òèêà
   if (count>64) {
      SATL[0]=0
      +0.0982862174*ticker[0]
      +0.0975682269*ticker[1]
      +0.0961401078*ticker[2]
      +0.0940230544*ticker[3]
      +0.0912437090*ticker[4]
      +0.0878391006*ticker[5]
      +0.0838544303*ticker[6]
      +0.0793406350*ticker[7]
      +0.0743569346*ticker[8]
      +0.0689666682*ticker[9]
      +0.0632381578*ticker[10]
      +0.0572428925*ticker[11]
      +0.0510534242*ticker[12]
      +0.0447468229*ticker[13]
      +0.0383959950*ticker[14]
      +0.0320735368*ticker[15]
      +0.0258537721*ticker[16]
      +0.0198005183*ticker[17]
      +0.0139807863*ticker[18]
      +0.0084512448*ticker[19]
      +0.0032639979*ticker[20]
      -0.0015350359*ticker[21]
      -0.0059060082*ticker[22]
      -0.0098190256*ticker[23]
      -0.0132507215*ticker[24]
      -0.0161875265*ticker[25]
      -0.0186164872*ticker[26]
      -0.0205446727*ticker[27]
      -0.0219739146*ticker[28]
      -0.0229204861*ticker[29]
      -0.0234080863*ticker[30]
      -0.0234566315*ticker[31]
      -0.0231017777*ticker[32]
      -0.0223796900*ticker[33]
      -0.0213300463*ticker[34]
      -0.0199924534*ticker[35]
      -0.0184126992*ticker[36]
      -0.0166377699*ticker[37]
      -0.0147139428*ticker[38]
      -0.0126796776*ticker[39]
      -0.0105938331*ticker[40]
      -0.0084736770*ticker[41]
      -0.0063841850*ticker[42]
      -0.0043466731*ticker[43]
      -0.0023956944*ticker[44]
      -0.0005535180*ticker[45]
      +0.0011421469*ticker[46]
      +0.0026845693*ticker[47]
      +0.0040471369*ticker[48]
      +0.0052380201*ticker[49]
      +0.0062194591*ticker[50]
      +0.0070340085*ticker[51]
      +0.0076266453*ticker[52]
      +0.0080376628*ticker[53]
      +0.0083037666*ticker[54]
      +0.0083694798*ticker[55]
      +0.0082901022*ticker[56]
      +0.0080741359*ticker[57]
      +0.0077543820*ticker[58]
      +0.0073260526*ticker[59]
      +0.0068163569*ticker[60]
      +0.0062325477*ticker[61]
      +0.0056078229*ticker[62]
      +0.0049516078*ticker[63]
      +0.0161380976*ticker[64];
   }
   for (i=0; i<BarsCount; i++) {
      buffer0[i]=ticker[i];
      buffer1[i]=SATL[i];
   }
   buffer0[BarsCount]=0.0;
   buffer1[BarsCount]=0.0;
   IndicatorShortName("Ticker SATL ("+count+")");
}

Comments