I want to display a tick volume in my chart(not in separate window).....
it needs to look like the default volume on chart of MT4.
Thanks
it needs to look like the default volume on chart of MT4.
Thanks
forexflash
MT4 - Terminal window in separate window? 44 replies
Indi that plots the data-window in the main chart-window? 0 replies
How to determine thru code which chart window has focus 0 replies
Changing histogram style in code 4 replies
Stoch window above price window/ separate price indicator? 2 replies
DislikedIf you don't want to use objects, then I'd find the highest or lowest value in the time frame view and add or subtract that from the ticks. Then you can put it at any level on screen. The server should be running to write this kind of indi.Ignored
//+------------------------------------------------------------------+ //| Level Sensor.mq4 | //| Copyright © 2005, Sfen. | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, Sfen" #property indicator_chart_window // input parameters extern int MAX_HISTORY = 500; extern int STEP = 1; extern int j = 0; extern double SDVIG=18; //---- extern string OBJECT_PREFIX = "LEVELS"; extern int ObjectId = 0; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double CSH(int shift) { return (MathMax(Open[shift], Close[shift])); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double CSL(int shift) { return (MathMin(Open[shift],Close[shift])); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ string IntToStr(int X) { return (DoubleToStr(X, 0)); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ string ObGetUniqueName(string Prefix) { ObjectId++; return (Prefix+" "+IntToStr(ObjectId)); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void ObDeleteObjectsByPrefix(string Prefix) { int L = StringLen(Prefix); int i = 0; while(i < ObjectsTotal()) { string ObjName = ObjectName(i); if(StringSubstr(ObjName, 0, L) != Prefix) { i++; continue; } ObjectDelete(ObjName); } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int deinit() { ObDeleteObjectsByPrefix(OBJECT_PREFIX); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { string S; ObDeleteObjectsByPrefix(OBJECT_PREFIX); double HH = 0; double LL = 1000000; int i; int History = MathMin(Bars,MAX_HISTORY); for(i = j+1; i < History; i++) { HH = MathMax(HH, CSH(i)); LL = MathMin(LL, CSL(i)); } int NumberOfPoints = (HH - LL) / (1.0*Point*STEP) + 1; int Count[]; ArrayResize(Count, NumberOfPoints); for(i = j; i < NumberOfPoints; i++) Count[i] = 0; for(i = j+1; i < History; i++) { double C = CSL(i); while(C < CSH(i)) { int Index = (C-LL) / (1.0*Point*STEP); Count[Index]++; C += 1.0*Point*STEP; } } for(i = j; i < NumberOfPoints; i++) { double StartX = Time[0]+SDVIG*Period()*60; double StartY = LL + 1.0*Point*STEP*i; double EndX = (Time[0+Count[i]]+SDVIG*Period()*60); double EndY = StartY; string ObjName = ObGetUniqueName(OBJECT_PREFIX); ObjectDelete(ObjName); ObjectCreate(ObjName, OBJ_TREND, 0, StartX, StartY, EndX, EndY); ObjectSet(ObjName, OBJPROP_RAY, 0); ObjectSet(ObjName, OBJPROP_COLOR, Olive); ObjectSet(ObjName, OBJPROP_BACK, 1); } return(0); } //+------------------------------------------------------------------+