Get final bar of the each day

How to get final bar of the each day

i want to summarize the calculation throughout the day and get it final bar in the exploration if i use the below code then i don't get the calculations for the final day

Q = DateNum();
	if (Q[i]!= Q[i-1])
	{ }

plz help me

If you are expecting a serious reply, you need to take time and post in detail what exactly you want.
Use snapshots if you're not able to type so well.

There are already summarize functions for AB AA window.

If you to add or Sum or Cum a certain variable for each symbol, there are functions which already do that.

The code snippet you have posted doesn't add any context to your question.

1 Like

I want to get summery row for every end of the day for this i try the following code

ChOI = OI - Ref(OI,-1);
TO = 0;
TH = 0;
TL = 99999;
TChOI = 0;
Q = DateNum();
PT = TimeNum();
	if (Q[i]== Q[i-1])
       TO[i]== IIf(PT[i] == PT[i-1],TO,O[i]);
       TH[i]== IIf(H[i]> TH,H[i],TH);
		TL[i] == IIf(L[I] < TL,L[i],TL);
       TChOI[i] == TChOI[i-1]+ChOI[i]; 
      if( Q[i] != Q[i-1])
      CO[i-1] = TO;
      TO = O[i];
      HH[i-1] = TH;
      TH = H[i];
	   LL[i-1] = TL;
      TL = L[i];
	   CC[i-1] = C[i-1];
      CChOI[i-1] = TChOI;
      TChOI = ChOI[i];
Filter =  1;
SetOption("NoDefaultColumns", True);
AddColumn(DateTime(), "Date", formatDateTime);
AddColumn(CO, "Open");
AddColumn(HH, "High");
AddColumn(LL, "Low");
AddColumn(CC, "Colse");
AddColumn(CchOI, "CchOI");

i achieved the summery but i don't get the summery for the last day because using

if( Q[i] != Q[i-1])

in the code my code compare the datenum

Honestly, this is not the way to do whatever you are trying to do.

Anyway, that's all up to you and i'll also want to save my own time.

Your problem seems to be, in the current iteration, you are assigning previous index.

if( Q[i] != Q[i-1])
      CO[i-1] = TO;
      TO = O[i];
      HH[i-1] = TH;  // These type of variables are in AddColumn()

in which iteration does HH[i] ever get filled?

plz guide me to the best way.

please don,t think waste of time

Firstly, kindly write long and elaborate sentences to depict exactly what you want to do. Not one or two keywords.

Secondly, I don't see the need to run a loop and aggregate the way you want, why don't you just change the Time Frame, using TimeFrameSet() to daily, and get the arrays in Daily.

Study about TimeFrame and Array (Vectors) in general and get an idea of how Amibroker works.
You will need to cange conventional thinking of running loops for every task as in scalar programming.


Thanks it helps me i did it