//+------------------------------------------------------------------+ //| #TickPrice.mq4 | //| | //| | //+------------------------------------------------------------------+ #property copyright "JDP" #property link "" #property indicator_buffers 2 #property indicator_color1 White #property indicator_color2 White #property indicator_separate_window double bid[],ask[]; extern bool MoveObjects=true; int LastTm; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1); SetIndexBuffer(0,ask); SetIndexLabel(0,"Ask"); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1); SetIndexBuffer(1,bid); SetIndexLabel(1,"Bid"); string shortname=Symbol()+"-#TickPrice"; IndicatorShortName(shortname); LastTm = Time[0]; //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i,total,oTm; int counted_bars=IndicatorCounted(); //---- if (LastTm < Time[0]) { for (i = 0;i<1000;i++) { ask[i] = ask[i+1]; bid[i] = bid[i+1]; } if (MoveObjects==true) { total = ObjectsTotal(); for (i=0;i<total;i++) { oTm =ObjectGet(ObjectName(i),OBJPROP_TIME1); oTm = oTm + (60*Period()); ObjectSet(ObjectName(i),OBJPROP_TIME1,oTm); } } LastTm = Time[0]; } for (i = 1001;i>0;i--) { ask[i] = ask[i-1]; bid[i] = bid[i-1]; } if (MoveObjects==true) { total = ObjectsTotal(); for (i=0;i<total;i++) { oTm =ObjectGet(ObjectName(i),OBJPROP_TIME1); oTm = oTm - (60*Period()); ObjectSet(ObjectName(i),OBJPROP_TIME1,oTm); } } ask[0] = Ask; bid[0] = Bid; //---- return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains open time of each bar
Indicator Curves created:
Implements a curve of type DRAW_LINE
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features: