Function for one result per day

 
Hi professionals,
I just need to get one result per day
But the result changes with condition change through the day and expert restart so please advise. Thank you
 
eyes:
Hi professionals,
I just need to get one result per day
But the result changes with condition change through the day and expert restart so please advise. Thank you

simply..

//+------------------------------------------------------------------+
//|                                                           ee.mq4 |
//|                                        Copyright 2021, HaskayaFx |
//|                                   https://www.haskayayazilim.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, HaskayaFx"
#property link      "https://www.haskayayazilim.net"
#property version   "1.00"
#property strict
#property indicator_chart_window
datetime prevtime;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| 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(iTime(Symbol(),PERIOD_D1,0) == prevtime)   return(0);
   prevtime = iTime(Symbol(),PERIOD_D1,0);
  
  // Your Code....
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
Reason: