Quote:
Originally Posted by mos
the mindex dont work on my ibfx platform (mini account) . but it does work on demo.
someone know how to solve the problem?? i tried to add "m" in the code but it didnt help.
thx
|
I had to modify the code to get it to work w/ibfx mini:
//+------------------------------------------------------------------+
//| MIndex.mq4 |
//| Copyright © 2005, Yuri Makarov. |
//|
MakSite : Home*Page |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Yuri Makarov."
#property link "http://mak.tradersmind.com"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 OrangeRed
extern string Curency = "USD";
double EurUsdm[],UsdChfm[],GbpUsdm[],UsdJpym[],AudUsdm[],NzdUsdm[],UsdCadm[];
double Idx[];
int init()
{
IndicatorShortName(Curency);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,Idx);
return(0);
}
void start()
{
ArrayCopySeries(EurUsdm,MODE_CLOSE,"EURUSDm");
ArrayCopySeries(GbpUsdm,MODE_CLOSE,"GBPUSDm");
ArrayCopySeries(AudUsdm,MODE_CLOSE,"AUDUSDm");
ArrayCopySeries(UsdChfm,MODE_CLOSE,"USDCHFm");
ArrayCopySeries(UsdJpym,MODE_CLOSE,"USDJPYm");
ArrayCopySeries(NzdUsdm,MODE_CLOSE,"NZDUSDm");
ArrayCopySeries(UsdCadm,MODE_CLOSE,"USDCADm");
int counted_bars=IndicatorCounted();
double USD;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
for(int i=0; i<limit; i++)
{
USD = MathPow(UsdChfm[i]*UsdJpym[i]*UsdCadm[i]/EurUsdm[i]/GbpUsdm[i]/NzdUsdm[i]/AudUsdm[i],1./8.);
if (Curency == "USD") Idx[i] = USD;
if (Curency == "EUR") Idx[i] = USD*EurUsdm[i];
if (Curency == "GBP") Idx[i] = USD*GbpUsdm[i];
if (Curency == "AUD") Idx[i] = USD*AudUsdm[i];
if (Curency == "CHF") Idx[i] = USD/UsdChfm[i];
if (Curency == "JPY") Idx[i] = USD/UsdJpym[i];
if (Curency == "NZD") Idx[i] = USD*NzdUsdm[i];
if (Curency == "CAD") Idx[i] = USD/UsdCadm[i];
}
}