ZigZag with cumulative volume for each wave

 

Hello,

 I'am looking for an adapt ZigZag showing the cumulative volume for each ZigZag, for expample like this.

 Zigzag with Volume 

 Do you have any ideas to build up a Zigzag with volume?

 Greetings

Mike 

 
I want to have one, but I don't know how to get it done
 

So far I got the volume for each ZigZag but my TextObject for the volume is not working

 

//+------------------------------------------------------------------+
// Creating and initializing an object to display the volume 
// x: Time of bar
// y: Price of bar
//+------------------------------------------------------------------+
void CreateText(datetime x,double y,string text)
  { 
//--- generate a name for a new edit object
   string name="Text_"+(string)x+"_"+(string)y;
//--- create a new edit object
   if(!ObjectCreate(0,name,OBJ_LABEL,0,0,0))
     {
      Print("Cannot create: '",name,"'");
      return;
     }
//--- set coordinates etc.
   ObjectSetString(0,name,OBJPROP_FONT,"Arial");
   ObjectSetInteger(0,name,OBJPROP_FONTSIZE,10);
   ObjectSetString(0,name,OBJPROP_TEXT,string(text));
   ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(0,name,OBJPROP_COLOR,YellowGreen);
   ObjectMove(0,name,0,x,y);
  }

The result is not what I expected:

 

I want to place the cumulated volume over/under each bar, but my binding for the object :  ObjectMove(0,name,0,x,y); is not working so far...

 

 

 

I made some tests with arrow objects. That works fine:

int OnInit()
  {
   string name="Text";
//--- create a new edit object
   if(!ObjectCreate(0,name,OBJ_ARROW_THUMB_DOWN,0,D'29.03.2012 20:00',1.32715))
     {
      Print("Cannot create: '",name,"'");
      return(-1);
     }
//--- settings
   ObjectSetInteger(0,name,OBJPROP_COLOR,YellowGreen);
   return(0);
  }

 

but with a text object I got the following result:

int OnInit()
  {
  
//--- generate a name for a new edit object
   string name="Text";
//--- create a new edit object
   if(!ObjectCreate(0,name,OBJ_LABEL,0,D'29.03.2012 20:00',1.32715))
     {
      Print("Cannot create: '",name,"'");
      return(-1);
     }
//--- settings
   ObjectSetString(0,name,OBJPROP_FONT,"Arial");
   ObjectSetInteger(0,name,OBJPROP_FONTSIZE,10);
   ObjectSetString(0,name,OBJPROP_TEXT,string("100"));
   ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(0,name,OBJPROP_COLOR,YellowGreen);
   return(0);
  }
  

 

Is there anyone who knows how to place text objects with a datetime/price base, as it works with arrow objects?

Thanks

Mike 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
 
You should use OBJ_TEXT
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
 

So, any success with this indicator? I'm using similar system with zigzags, checking time and price retracements. Might add volume to the mix

 

CHeers,

Kurt Osis 

Reason: