Akuma99 Atmosphere

Download script
Akuma99 Atmosphere

The Akuma99 Atmosphere indicator is designed to provide traders with a clear visual representation of different global trading sessions on their charts. By segmenting the 24-hour trading day into specific time blocks, it helps users identify which geographic markets are currently active.

Core Logic and Functionality

The script operates by scanning the historical timeline of your price charts and categorizing every hour into one of three primary global sessions: Asian, European, and US markets. It then draws distinct visual markers (histograms) on the chart to highlight these periods.

Here is how the logic breaks down:

  • Time-Based Segmentation: The tool looks at the specific hour of each candle on your chart. Based on the time, it assigns that candle to a corresponding session:

    • Asian Session: Covers the early morning hours (typically 00:00 to 07:00).
    • European Session: Covers the mid-day hours (typically 08:00 to 15:00).
    • US Session: Covers the late afternoon and evening hours (typically 16:00 to 23:00, including a specific check for midnight).
  • Customizable Time Shift: The logic includes an "offset" feature. This allows you to shift all session times forward or backward by a set number of hours. This is particularly useful for adjusting the indicator to match your specific local time zone without having to rewrite any underlying settings.

  • Visual Representation: To make the data easy to read at a glance, the indicator uses six different visual layers. Each session is assigned its own unique color and position on the chart. When a specific time block occurs, the corresponding "Atmosphere" highlight appears, allowing you to see exactly when the market transition from one region to another takes place.

How it Benefits the User

Instead of manually calculating what time it is in London, New York, or Tokyo, this tool automates that process. It provides a continuous visual background on your price action, helping you identify high-volatility periods and understand the "atmosphere" of the market based on which global region is currently trading.

Miscellaneous
Implements a curve of type %1
17 Views
0 Downloads
0 Favorites
Akuma99 Atmosphere
/*

*********************************************************************
          
                    Akuma99 Atmosphere
                   Copyright © 2005  Akuma99
                  http://akuma99.blogspot.com    

       For help on this indicator, tutorials and information 
               visit http://akuma99.blogspot.com/
                  
*********************************************************************

*/

#property link        "http://akuma99.blogspot.com/"
#property copyright   "© 2005 Akuma99 (http://akuma99.blogspot.com)"

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 OldLace
#property indicator_color2 OldLace
#property indicator_color3 LightYellow
#property indicator_color4 LightYellow
#property indicator_color5 MintCream
#property indicator_color6 MintCream

extern double offset = 0;

double asia1[];
double asia2[];
double europe1[];
double europe2[];
double us1[];
double us2[];

int init() {
   
   IndicatorBuffers(6);
   
   SetIndexStyle(0,DRAW_HISTOGRAM, 0, 5, indicator_color1);
   SetIndexBuffer(0, asia1);
   SetIndexLabel(0,"Asian session");
   
   SetIndexStyle(1,DRAW_HISTOGRAM, 0, 5, indicator_color2);
   SetIndexBuffer(1, asia2);
   SetIndexLabel(1,"Asian session");
   
   SetIndexStyle(2,DRAW_HISTOGRAM, 0, 5, indicator_color3);
   SetIndexBuffer(2, europe1);
   SetIndexLabel(2,"European session");
   
   SetIndexStyle(3,DRAW_HISTOGRAM, 0, 5, indicator_color4);
   SetIndexBuffer(3, europe2);
   SetIndexLabel(3,"European session");
   
   SetIndexStyle(4,DRAW_HISTOGRAM, 0, 5, indicator_color5);
   SetIndexBuffer(4, us1);
   SetIndexLabel(4,"US session");
   
   SetIndexStyle(5,DRAW_HISTOGRAM, 0, 5, indicator_color6);
   SetIndexBuffer(5, us2);
   SetIndexLabel(5,"US session");
   
   return(0);

}

int start() {
   
   int   counted_bars=IndicatorCounted();
   int   limit = Bars-counted_bars;
   int   i;
   
   for (i=limit; i>=0; i--) {
      
      if (TimeHour(Time[i]) >= 0+offset && TimeHour(Time[i]) <= 7+offset) {

         asia1[i]=1000;
         asia2[i]=0;

         
      } else if (TimeHour(Time[i]) >= 8+offset && TimeHour(Time[i]) <= 15+offset) {
      
         europe1[i]=1000;
         europe2[i]=0;

      
      } else if (TimeHour(Time[i]) >= 16+offset && TimeHour(Time[i]) <= 23+offset) {
      
         us1[i]=1000;
         us2[i]=0;
         
      
      } else if (TimeHour(Time[i]) == 0) {
         
         us1[i]=1000;
         us2[i]=0;
         
      } else {
      
         asia1[i]=1000;
         asia2[i]=0;
      
      }
     
      
   }
      
   return(0);

}

Comments