Ticker RTSL

Download script
Author: mandorr@gmail.com
Ticker RTSL

This tool is a specialized technical indicator designed for the MetaTrader 4 platform. It functions by tracking real-time price movements and performing a specific mathematical calculation to generate a secondary data line, which provides a processed view of market activity.

Data Collection and Tracking

The script monitors the "Bid" price of the financial instrument you are currently viewing. Rather than reacting to every microscopic fluctuation, it identifies distinct price changes. Every time the price moves to a new level, the tool records that value into a chronological history (a buffer). This allows the script to keep a memory of recent price action in a sequence.

The Calculation Logic

The core of this tool is a weighted mathematical formula. Once the indicator has gathered enough data points (specifically after 99 price changes have occurred), it begins calculating a value for the "RTSL" line.

This calculation works by:

  • Weighting Historical Data: It takes the last 99 unique price points recorded.
  • Applying Coefficients: Each of these 99 price points is multiplied by a specific, pre-defined numerical weight (some positive, some negative).
  • Summation: All these weighted values are added together to produce a single result.

Visual Representation

The indicator displays two distinct lines in a separate window at the bottom of your chart:

  1. Ticker: This represents the raw price history as it progresses.
  2. RTSL: This is the resulting line derived from the weighted calculation described above.

Summary of Behavior

By using a complex set of multipliers against a moving window of 99 prices, the tool creates a smoothed or transformed representation of the market trend. Because the weights are fixed and specific, the indicator provides a consistent, non-random output based entirely on the sequence of price movements. It effectively "filters" the raw ticker data into a custom technical signal for the user to observe.

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

#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 RTSL[];   // áóôåð RTSL
double buffer0[];
double buffer1[];

void init() {
   SetIndexBuffer(0,buffer0);
   SetIndexBuffer(1,buffer1);
   SetIndexLabel(0,"Ticker");
   SetIndexLabel(1,"RTSL");
   SetIndexDrawBegin(0,0);
   SetIndexDrawBegin(1,0);
   SetIndexEmptyValue(0,0.0);
   SetIndexEmptyValue(1,0.0);
   ArrayResize(ticker,BarsCount);
   ArrayResize(RTSL,BarsCount);
   for (int i=0; i<BarsCount; i++) {
      ticker[i]=0.0;
      RTSL[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];
      RTSL[i]=RTSL[i-1];
   }
   ticker[0]=price*Point;
   // Ëèíèÿ RTSL íà÷èíàåò ðèñîâàòüñÿ ñ 99 òèêà
   if (count>98) {
      RTSL[0]= 
      -0.00514293*ticker[0]
      -0.00398417*ticker[1]
      -0.00262594*ticker[2]
      -0.00107121*ticker[3]
      +0.00066887*ticker[4]
      +0.00258172*ticker[5]
      +0.00465269*ticker[6]
      +0.00686394*ticker[7]
      +0.00919334*ticker[8]
      +0.01161720*ticker[9]
      +0.01411056*ticker[10]
      +0.01664635*ticker[11]
      +0.01919533*ticker[12]
      +0.02172747*ticker[13]
      +0.02421320*ticker[14]
      +0.02662203*ticker[15]
      +0.02892446*ticker[16]
      +0.03109071*ticker[17]
      +0.03309496*ticker[18]
      +0.03490921*ticker[19]
      +0.03651145*ticker[20]
      +0.03788045*ticker[21]
      +0.03899804*ticker[22]
      +0.03984915*ticker[23]
      +0.04042329*ticker[24]
      +0.04071263*ticker[25]
      +0.04071263*ticker[26]
      +0.04042329*ticker[27]
      +0.03984915*ticker[28]
      +0.03899804*ticker[29]
      +0.03788045*ticker[30]
      +0.03651145*ticker[31]
      +0.03490921*ticker[32]
      +0.03309496*ticker[33]
      +0.03109071*ticker[34]
      +0.02892446*ticker[35]
      +0.02662203*ticker[36]
      +0.02421320*ticker[37]
      +0.02172747*ticker[38]
      +0.01919533*ticker[39]
      +0.01664635*ticker[40]
      +0.01411056*ticker[41]
      +0.01161720*ticker[42]
      +0.00919334*ticker[43]
      +0.00686394*ticker[44]
      +0.00465269*ticker[45]
      +0.00258172*ticker[46]
      +0.00066887*ticker[47]
      -0.00107121*ticker[48]
      -0.00262594*ticker[49]
      -0.00398417*ticker[50]
      -0.00514293*ticker[51]
      -0.00609634*ticker[52]
      -0.00684602*ticker[53]
      -0.00739452*ticker[54]
      -0.00774847*ticker[55]
      -0.00791630*ticker[56]
      -0.00790940*ticker[57]
      -0.00774085*ticker[58]
      -0.00742482*ticker[59]
      -0.00697718*ticker[60]
      -0.00641613*ticker[61]
      -0.00576108*ticker[62]
      -0.00502957*ticker[63]
      -0.00423873*ticker[64]
      -0.00340812*ticker[65]
      -0.00255923*ticker[66]
      -0.00170217*ticker[67]
      -0.00085902*ticker[68]
      -0.00004113*ticker[69]
      +0.00073700*ticker[70]
      +0.00146422*ticker[71]
      +0.00213007*ticker[72]
      +0.00272649*ticker[73]
      +0.00324752*ticker[74]
      +0.00368922*ticker[75]
      +0.00405000*ticker[76]
      +0.00433024*ticker[77]
      +0.00453068*ticker[78]
      +0.00465046*ticker[79]
      +0.00469058*ticker[80]
      +0.00466041*ticker[81]
      +0.00457855*ticker[82]
      +0.00442491*ticker[83]
      +0.00423019*ticker[84]
      +0.00399201*ticker[85]
      +0.00372169*ticker[86]
      +0.00342736*ticker[87]
      +0.00311822*ticker[88]
      +0.00280309*ticker[89]
      +0.00249088*ticker[90]
      +0.00219089*ticker[91]
      +0.00191283*ticker[92]
      +0.00166683*ticker[93]
      +0.00146419*ticker[94]
      +0.00131867*ticker[95]
      +0.00124645*ticker[96]
      +0.00126836*ticker[97]
      -0.00401854*ticker[98]
      ;
   }
   for (i=0; i<BarsCount; i++) {
      buffer0[i]=ticker[i];
      buffer1[i]=RTSL[i];
   }
   buffer0[BarsCount]=0.0;
   buffer1[BarsCount]=0.0;
   IndicatorShortName("Ticker RTSL ("+count+")");
}

Comments