#Signal_Bars_info

Author: Copyright � 2008, cja.
#Signal_Bars_info
Price Data Components
Series array that contains the highest prices of each barSeries array that contains the lowest prices of each barSeries array that contains open prices of each barSeries array that contains close prices for each barSeries array that contains the highest prices of each barSeries array that contains the lowest prices of each bar
0 Views
0 Downloads
0 Favorites
#Signal_Bars_info
//+------------------------------------------------------------------+
//|                                        #Signal_Bars_v3_Daily.mq4 |
//|                                           Copyright © 2008, cja. |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, cja."
#property link      " ccjjaa@gmail.com "
#property indicator_chart_window

extern bool Corner_of_Chart_RIGHT_TOP = true;
extern bool Show_Smaller_Size = false;
extern int Shift_UP_DN =0; 
extern int Adjust_Side_to_side  = 20;
extern color CommentLabel_color = LightSteelBlue;


//****************************************

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectDelete("SIG_INFO_1");ObjectDelete("SIG_INFO_2");
   ObjectDelete("SIG_INFO_3");ObjectDelete("SIG_INFO_4");
   ObjectDelete("SIG_INFO_5");ObjectDelete("SIG_INFO_6");
   ObjectDelete("SIG_INFO_7");ObjectDelete("SIG_INFO_8");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {    
   //***********************************************************************************************************************
   //MACD Signals
   int    counted_bars=IndicatorCounted();
//----
   
   int R1=0,R5=0,R10=0,R20=0,RAvg=0,i=0;
   R1 =  (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point;
   for(i=1;i<=5;i++)
      R5    =    R5  +  (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
   for(i=1;i<=10;i++)
      R10   =    R10 +  (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
   for(i=1;i<=20;i++)
      R20   =    R20 +  (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;

   R5 = R5/5;
   R10 = R10/10;
   R20 = R20/20;
   RAvg  =  (R1+R5+R10+R20)/4;    
   
   string HI="",LO="",SPREAD="",PIPS="",DAV="",HILO="",PRC,Pips="",Av="",AV_Yest="";
   color color_pip,color_av;
   double OPEN = iOpen(NULL,1440,0);
   double CLOSE = iClose(NULL,1440,0);
   double SPRD = (Ask - Bid)/Point;
   double High_Today = iHigh(NULL,1440,0);
   double Low_Today = iLow(NULL,1440,0);
   PIPS =  DoubleToStr((CLOSE-OPEN)/Point,0);
   SPREAD = (DoubleToStr(SPRD,Digits-4));
   DAV = (DoubleToStr(RAvg,Digits-4));
   AV_Yest =  (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point;
   HILO = DoubleToStr((High_Today-Low_Today)/Point,0);
  
     if (CLOSE >= OPEN) {Pips= "-";color_pip = Lime; }
     if (CLOSE < OPEN) {Pips= "-";color_pip = OrangeRed; }
      if (DAV > AV_Yest) {Av= "-";color_av = Lime; }
     if (DAV < AV_Yest) {Av= "-";color_av = OrangeRed; }
     
  
  if (Show_Smaller_Size  == false)
    {     
                   ObjectCreate("SIG_INFO_1", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_1","Spread", 12, "Arial", CommentLabel_color);
   ObjectSet("SIG_INFO_1", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_1", OBJPROP_XDISTANCE, 45+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_1", OBJPROP_YDISTANCE, 20+Shift_UP_DN); 
   
               ObjectCreate("SIG_INFO_2", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_2",""+SPREAD+"", 12, "Arial Bold", Gold);
   ObjectSet("SIG_INFO_2", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_2", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_2", OBJPROP_YDISTANCE, 20+Shift_UP_DN);  
   
     
                ObjectCreate("SIG_INFO_3", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_3","Pips to Open", 12, "Arial", CommentLabel_color);
   ObjectSet("SIG_INFO_3", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_3", OBJPROP_XDISTANCE, 45+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_3", OBJPROP_YDISTANCE, 37+Shift_UP_DN); 
   
               ObjectCreate("SIG_INFO_4", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_4",""+PIPS+"", 12, "Arial Bold", color_pip);
   ObjectSet("SIG_INFO_4", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_4", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_4", OBJPROP_YDISTANCE, 37+Shift_UP_DN);  
      
                ObjectCreate("SIG_INFO_5", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_5","Hi to Low", 12, "Arial", CommentLabel_color);
   ObjectSet("SIG_INFO_5", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_5", OBJPROP_XDISTANCE, 45+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_5", OBJPROP_YDISTANCE, 54+Shift_UP_DN); 
   
               ObjectCreate("SIG_INFO_6", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_6",""+HILO+"", 12, "Arial Bold", Gold);
   ObjectSet("SIG_INFO_6", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_6", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_6", OBJPROP_YDISTANCE, 54+Shift_UP_DN);  
   
                 ObjectCreate("SIG_INFO_7", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_7","Daily Av", 12, "Arial",CommentLabel_color);
   ObjectSet("SIG_INFO_7", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_7", OBJPROP_XDISTANCE, 45+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_7", OBJPROP_YDISTANCE, 71+Shift_UP_DN); 
   
               ObjectCreate("SIG_INFO_8", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_8",""+DAV+"", 12, "Arial Bold", color_av);
   ObjectSet("SIG_INFO_8", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_8", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_8", OBJPROP_YDISTANCE, 71+Shift_UP_DN); 
 }
 
  //***********************************************************************
  
  if (Show_Smaller_Size  == true)
    {     
                   ObjectCreate("SIG_INFO_1", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_1","Spread", 9, "Arial", CommentLabel_color);
   ObjectSet("SIG_INFO_1", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_1", OBJPROP_XDISTANCE, 40+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_1", OBJPROP_YDISTANCE, 20+Shift_UP_DN); 
   
               ObjectCreate("SIG_INFO_2", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_2",""+SPREAD+"", 9, "Arial Bold", Gold);
   ObjectSet("SIG_INFO_2", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_2", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_2", OBJPROP_YDISTANCE, 20+Shift_UP_DN);  
   
     
                ObjectCreate("SIG_INFO_3", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_3","Pips to Open", 9, "Arial", CommentLabel_color);
   ObjectSet("SIG_INFO_3", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_3", OBJPROP_XDISTANCE, 40+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_3", OBJPROP_YDISTANCE, 35+Shift_UP_DN); 
   
               ObjectCreate("SIG_INFO_4", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_4",""+PIPS+"", 9, "Arial Bold", color_pip);
   ObjectSet("SIG_INFO_4", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_4", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_4", OBJPROP_YDISTANCE, 35+Shift_UP_DN);  
      
                ObjectCreate("SIG_INFO_5", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_5","Hi to Low", 9, "Arial", CommentLabel_color);
   ObjectSet("SIG_INFO_5", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_5", OBJPROP_XDISTANCE, 40+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_5", OBJPROP_YDISTANCE, 50+Shift_UP_DN); 
   
               ObjectCreate("SIG_INFO_6", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_6",""+HILO+"", 9, "Arial Bold", Gold);
   ObjectSet("SIG_INFO_6", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_6", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_6", OBJPROP_YDISTANCE, 50+Shift_UP_DN);  
   
                 ObjectCreate("SIG_INFO_7", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_7","Daily Av", 9, "Arial",CommentLabel_color);
   ObjectSet("SIG_INFO_7", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_7", OBJPROP_XDISTANCE, 40+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_7", OBJPROP_YDISTANCE, 65+Shift_UP_DN); 
   
               ObjectCreate("SIG_INFO_8", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SIG_INFO_8",""+DAV+"", 9, "Arial Bold", color_av);
   ObjectSet("SIG_INFO_8", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
   ObjectSet("SIG_INFO_8", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
   ObjectSet("SIG_INFO_8", OBJPROP_YDISTANCE, 65+Shift_UP_DN); 
 }
 //----
   return(0);
  }
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---