Here is complete code:
int f0_4(BarData *bars, int barcount,int ai_0, int ai_4, int ai_8) { vector<double>lda_112;
vector<double>lda_24;
vector<double>lda_241;
vector<double>lda_242;
vector<double>lda_243;
vector<double>lda_28;
vector<double>lda_281;
vector<double>lda_282;
vector<double>lda_283;
int li_ret_60=0;
int count_64;
double ld_40 = -999999;
double gda_152=0.0;
double gia_148=0.0;
for (int index_48 = 0; index_48 < ai_4; index_48++) {
lda_24.push_back(bars[bar_index(ai_0 + index_48, barcount)].close);
lda_241[index_48] = bars[bar_index(ai_0 + index_48, barcount)].open;
lda_242[index_48] = bars[bar_index(ai_0 + index_48, barcount)].high;
lda_243[index_48] = bars[bar_index(ai_0 + index_48, barcount)].low;
}
for (int index_52 = ai_4; index_52 < ai_8; index_52++) {
for (int index_48 = 0; index_48 < ai_4; index_48++) {
lda_28[index_48] = bars[bar_index(index_48 + index_52, barcount)].close;
lda_281[index_48] = bars[bar_index(index_48 + index_52, barcount)].open;
lda_282[index_48] = bars[bar_index(index_48 + index_52, barcount)].high;
lda_283[index_48] = bars[bar_index(index_48 + index_52, barcount)].low;
}
lda_112.push_back(f0_55(lda_24, lda_28));
if (lda_112[index_52] > ld_40) {
ld_40 = lda_112[index_52];
li_ret_60 = index_52;
}
}
gda_152= ld_40;
gia_148= li_ret_60;
return li_ret_60;
}
double f0_55(vector<double>& ad_0, vector<double>& ad_4) {
double ld_44;
double ld_52;
int li_92;
int li_96;
double ld_76 = 0.0;
int size_0 = ad_0.size();
int size_4 = ad_4.size();
li_96 = MathMin(size_0 , size_4 );
vector<double> lda_12;
vector<double> lda_16;
for(int i=0;i<li_96;i++)lda_12.push_back(ad_0[i]);>
for(int i=0;i<li_96;i++)lda_16.push_back(ad_4[i]);>
double x=0.0;
double y=0.0;
double s=0.0;
double p1=0.0;
double p2=0.0;
double p=0.0;
for(int i=0;i<li_96;i++){>
x+=lda_12[i];
y+=lda_16[i];
}
x/=li_96;
y/=li_96;
for(int i=0;i<li_96;i++){>
s+=(lda_12[i]-x)*(lda_16[i]-y);
p1+=(lda_12[i]-x)*(lda_12[i]-x);
p2+=(lda_16[i]-y)*(lda_16[i]-y);
}
ld_76=s/sqrt(p1*p2);
return ld_76;
}
</double></double></double></double></double></double></double></double></double></double></double></double></double>