/////////////////////////////////////////////////////////
void count_index_f(int CC)
{
if(!use_lighFo_formula)
{
double sek_high=MathPow(iHigh(usdsek,TF,CC),0.042); if(sek_high==0) sek_high=1;
double sek_low=MathPow(iLow(usdsek,TF,CC),0.042); if(sek_low==0) sek_low=1;
double sek_open=MathPow(iOpen(usdsek,TF,CC),0.042); if(sek_open==0) sek_open=1;
double sek_close=MathPow(iClose(usdsek,TF,CC),0.042); if(sek_close==0) sek_close=1;
//usdX
high_=50.14348112*MathPow(iHigh(eurusd,TF,CC),-0.576)*MathPow(iHigh(usdjpy,TF,CC),0.136)*MathPow(iHigh(gbpusd,TF,CC),-0.119)
*MathPow(iHigh(usdcad,TF,CC),0.091)*sek_high*MathPow(iHigh(usdchf,TF,CC),0.036);
low_=50.14348112*MathPow(iLow(eurusd,TF,CC),-0.576)*MathPow(iLow(usdjpy,TF,CC),0.136)*MathPow(iLow(gbpusd,TF,CC),-0.119)
*MathPow(iLow(usdcad,TF,CC),0.091)*sek_low*MathPow(iLow(usdchf,TF,CC),0.036);
open_=50.14348112*MathPow(iOpen(eurusd,TF,CC),-0.576)*MathPow(iOpen(usdjpy,TF,CC),0.136)*MathPow(iOpen(gbpusd,TF,CC),-0.119)
*MathPow(iOpen(usdcad,TF,CC),0.091)*sek_open*MathPow(iOpen(usdchf,TF,CC),0.036);
close_=50.14348112*MathPow(iClose(eurusd,TF,CC),-0.576)*MathPow(iClose(usdjpy,TF,CC),0.136)*MathPow(iClose(gbpusd,TF,CC),-0.119)
*MathPow(iClose(usdcad,TF,CC),0.091)*sek_close*MathPow(iClose(usdchf,TF,CC),0.036);
}
else
if(use_lighFo_formula)
{
double hi=(iHigh(audusd,TF,CC)*iHigh(eurusd,TF,CC)*iHigh(gbpusd,TF,CC)); if(hi==0) hi=1;
double lo=(iLow(audusd,TF,CC)*iLow(eurusd,TF,CC)*iLow(gbpusd,TF,CC)); if(lo==0) lo=1;
double op=(iOpen(audusd,TF,CC)*iOpen(eurusd,TF,CC)*iOpen(gbpusd,TF,CC)); if(op==0) op=1;
double cl=(iClose(audusd,TF,CC)*iClose(eurusd,TF,CC)*iClose(gbpusd,TF,CC)); if(cl==0) cl=1;
high_=MathPow(((iHigh(usdcad,TF,CC)*iHigh(usdchf,TF,CC)*iHigh(usdjpy,TF,CC))/hi),1.0/7);
low_=MathPow(((iLow(usdcad,TF,CC)*iLow(usdchf,TF,CC)*iLow(usdjpy,TF,CC))/lo),1.0/7);
open_=MathPow(((iOpen(usdcad,TF,CC)*iOpen(usdchf,TF,CC)*iOpen(usdjpy,TF,CC))/op),1.0/7);
close_=MathPow(((iClose(usdcad,TF,CC)*iClose(usdchf,TF,CC)*iClose(usdjpy,TF,CC))/cl),1.0/7);
}
if(index_name==USD_X)
{
high_=high_;
low_=low_;
open_=open_;
close_=close_;
}
else
if(index_name==EUR_X)
{
high_=high_*iHigh(eurusd,TF,CC);
low_=low_*iLow(eurusd,TF,CC);
open_=open_*iOpen(eurusd,TF,CC);
close_=close_*iClose(eurusd,TF,CC);
}
else
if(index_name==GBP_X)
{
high_=high_*iHigh(gbpusd,TF,CC);
low_=low_*iLow(gbpusd,TF,CC);
open_=open_*iOpen(gbpusd,TF,CC);
close_=close_*iClose(gbpusd,TF,CC);
}
else
if(index_name==CHF_X)
{
double hi=iHigh(usdchf,TF,CC); if(hi==0) hi=1;
double lo=iLow(usdchf,TF,CC); if(lo==0) lo=1;
double op=iOpen(usdchf,TF,CC); if(op==0) op=1;
double cl=iClose(usdchf,TF,CC); if(cl==0) cl=1;
high_=high_/hi;
low_=low_/lo;
open_=open_/op;
close_=close_/cl;
}
else
if(index_name==CAD_X)
{
double hi=iHigh(usdcad,TF,CC); if(hi==0) hi=1;
double lo=iLow(usdcad,TF,CC); if(lo==0) lo=1;
double op=iOpen(usdcad,TF,CC); if(op==0) op=1;
double cl=iClose(usdcad,TF,CC); if(cl==0) cl=1;
high_=high_/hi;
low_=low_/lo;
open_=open_/op;
close_=close_/cl;
}
else
if(index_name==JPY_X)
{
double hi=high_; if(hi==0) hi=1;
double lo=low_; if(lo==0) lo=1;
double op=open_; if(op==0) op=1;
double cl=close_; if(cl==0) cl=1;
high_=iHigh(usdjpy,TF,CC)/hi;
low_=iLow(usdjpy,TF,CC)/lo;
open_=iOpen(usdjpy,TF,CC)/op;
close_=iClose(usdjpy,TF,CC)/cl;
}
else
if(index_name==AUD_X)
{
high_=high_*iHigh(audusd,TF,CC);
low_=low_*iLow(audusd,TF,CC);
open_=open_*iOpen(audusd,TF,CC);
close_=close_*iClose(audusd,TF,CC);
}
else
if(index_name==NZD_X)
{
high_=high_*iHigh(nzdusd,TF,CC);
low_=low_*iLow(nzdusd,TF,CC);
open_=open_*iOpen(nzdusd,TF,CC);
close_=close_*iClose(nzdusd,TF,CC);
}
}