Discussion of article "Creating Tick Indicators in MQL5" - page 2

 

How about this?

//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   if(prev_calculated==0)
     {
      ArrayInitialize(BidBuffer,0);
      ArrayInitialize(AskBuffer,0);

     }
.....
  }
 

thank you

i think it will be more effective when candle's of " tick indicator "

that refer to one candle of current time frame are integrated and/or separate from other group

 

Very nice. Thank you.

Could a time scale and a simple or exponential average be added to the tick candle indicator?

 

When the period of the chart is changed, the size of dynamic arrays BidBuffer[] and AskBuffer[] associated with indicator buffers is changed. After that the arrays are filled with "random" values, which differ from the values that were entered earlier; they also differ from the value 0, for which no rendering is specified. Therefore, each time before filling the arrays, you should initialise them with the value 0 (as denkir wrote):

if(prev_calculated==0)
  {
   ArrayInitialize(BidBuffer,0);
   ArrayInitialize(AskBuffer,0);

I attach the corrected version of the indicator.

Files:
 

Thank you!
Very interesting. The tickcandels may need to be added too

   if(prev_calculated==0)
     {
      //*************
      ArrayInitialize(TicksBuffer,0);
      ArrayInitialize(OpenBuffer,0);
      ArrayInitialize(HighBuffer,0);
      ArrayInitialize(LowBuffer,0);
      ArrayInitialize(CloseBuffer,0);
      //*************
 
Very Good work!
 

Can you please let me know how we can add this to MT4?

Also, can we use the moving average plots on this tick charts?

 
Praveen Moragaspitiya #: Can you please let me know how we can add this to MT4? Also, can we use the moving average plots on this tick charts?

MT4 does not store historical tick data. You would have to store the tick data yourself. Search the CodeBase as there should be several MT4 versions for Tick Charts.

 
Fernando Carreiro #:

MT4 does not store historical tick data. You would have to store the tick data yourself. Search the CodeBase as there should be several MT4 versions for Tick Charts.

Thanks for the response. 
 
hakita #:

Thank you for this Interesting article.

Using a file to buffer data was it mandatory ? 

Was not it possible to buffer history data in memory, using statis array ?

 

Regards 

 

How did he download tick without any tick downloading commands like copy ticks. I am confused could you please explain