#TickA_Volume

Download script
Author: JDP
#TickA_Volume

This tool is designed to provide traders with real-time insights into market momentum by analyzing the relationship between price movement and trading volume. Unlike standard indicators that only look at where the price is going, this script attempts to measure the "force" behind those movements to identify significant shifts in trend.

Core Logic and Mechanics

The logic operates on three primary pillars: price calculation, volume tracking, and momentum delta.

1. Real-Time Data Capture The script constantly monitors the current market environment by calculating the midpoint between the Bid and Ask prices. It simultaneously tracks the "Tick Volume," which represents the frequency of price changes within a specific timeframe.

2. Momentum Delta Calculation At every new price update, the script calculates two distinct types of change:

  • Price Change: The difference between the current midpoint price and the previous one.
  • Volume Change: The difference between the current tick volume and the previous volume recorded.

By multiplying these two changes together, the script generates a "Delta." This value represents the intensity of the movement; it accounts for whether the price is moving up or down, and how much volume is supporting that specific move.

3. Trend Tracking The script maintains a running history of these Delta values to build a trend line. It continuously updates this cumulative value to visualize the overall flow of the market. This allows the tool to distinguish between minor fluctuations and substantial shifts in market pressure.

Signals and Alerts

The primary purpose of the tool is to trigger visual and audible notifications when the momentum exceeds specific user-defined thresholds (the "Buy" and "Sell" levels).

  • Buy Signals: When the calculated momentum drops below a certain negative threshold, the script identifies a potential bullish opportunity. It places a blue arrow on the chart and triggers a "Buy" alert.
  • Sell Signals: When the momentum rises above a specific positive threshold, the script identifies a potential bearish opportunity. It places a red arrow on the chart and triggers a "Sell" alert.

Key Features for Users

  • Dynamic Visuals: The script automatically plots arrows on your chart to highlight exactly where trend reversals or significant momentum shifts occur.
  • Customizable Sensitivity: Traders can adjust the levels at which alerts are triggered, allowing for a personalized experience based on their specific trading style (e.g., making the tool more "sensitive" for scalping or "conservative" for longer trends).
  • Instant Notification: With the alert system enabled, the tool provides immediate feedback, ensuring traders don't miss rapid market shifts even when they aren't looking directly at the screen.
Price Data Components
Series array that contains tick volumes of each bar
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
9 Views
0 Downloads
0 Favorites
#TickA_Volume
//+------------------------------------------------------------------+
//|                          Instantaneous Trend Line by John Ehlers |
//|                               Copyright © 2004, Poul_Trade_Forum |
//|                                                         Aborigen |
//|                                          http://forex.kbpauk.ru/ |
//+------------------------------------------------------------------+
#property copyright "JDP"
#property link      ""
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
extern double BuyLevel = -0.0003;
extern double SellLevel = 0.0003;
extern bool alert=true;
//---- buffers
int LastTm;
int PVolume;
double PPrice;
double VUp[];
double VDn[];
double Price[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
   IndicatorBuffers(2);
//---- indicator line
   SetIndexStyle(0,DRAW_LINE,EMPTY,2,Red);
   SetIndexStyle(1,DRAW_LINE,EMPTY,2,Blue);
   SetIndexBuffer(0,VDn);
   SetIndexBuffer(1,VUp);
   SetIndexEmptyValue(0,0);
   SetIndexEmptyValue(1,0);
//---- name for DataWindow and indicator subwindow label
   short_name="#Tick-Volume";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
//----
   SetIndexDrawBegin(0,30);
   SetIndexDrawBegin(1,30);
//----

   return(0);
  }

int deinit(){return(0);}
int start()
  {
   double Price,VDelta,PDelta,Delta;
   int i,shift,count;
   string oname;
   if (LastTm < Time[0]) {
      for (i = 0;i<1000;i++) {
         VUp[i] = VUp[i+1];
         VDn[i] = VDn[i+1];
      }
      PVolume = 0;
      if (LastTm==0) {PVolume = iVolume(Symbol(),0,0);}
      if (LastTm==0) {PPrice = (Ask+Bid)/2;}
      LastTm = Time[0];   
   }
   for (i = 1001;i>0;i--) {
      VUp[i] = VUp[i-1];
      VDn[i] = VDn[i-1];
   }
   Price = (Ask+Bid)/2;
   VDelta = (iVolume(Symbol(),0,0)-PVolume);
   PDelta = Price - PPrice;
   Delta = VDelta * PDelta;
   VUp[0] = VUp[1] + Delta;
   PPrice = Price;
   PVolume = PVolume + VDelta;
   GlobalVariableSet("TV",0);
   if (VUp[0] - VUp[1] < BuyLevel) {
      //Up
      oname ="V-" + TimeLocal();
      ObjectCreate(oname,22,0,Time[0],Bid);
      ObjectSet(oname,OBJPROP_COLOR,Blue);
      ObjectSet(oname,OBJPROP_ARROWCODE,241);
      
      if (alert==true) {
         Alert("Buy "+oname);
      }   
   }
   if (VUp[0] - VUp[1] > SellLevel) {
      //Dn
      oname ="V-" + TimeLocal();
      ObjectCreate(oname,22,0,Time[0],Ask);
      ObjectSet(oname,OBJPROP_COLOR,Red);
      ObjectSet(oname,OBJPROP_ARROWCODE,242);
      if (alert==true) {
         Alert("Sell "+oname);
      }   
   }
   bool Found = false;
   for (i=10;i>=0;i--) {
      if (VUp[i] - VUp[i+1] < BuyLevel) {
         GlobalVariableSet("TV",1);
         Found = true;
      }   
      if (VUp[i] - VUp[i+1] > SellLevel) {
         GlobalVariableSet("TV",-1);
         Found = true;
      }   
   }   
   if (Found==false) {
      GlobalVariableSet("TV",0);
   }
return(0);
}



Comments