Indicators: DXYvsEXY for MT4 - page 2

 
Roberto Jacobs:

Why are you talking about multi currency indicators here?

The DXYvsEXY indicator is not a multi-currency indicator, but ...

Are you under some drug effect???

This is from "your" code:

string idx[]={"EXY","DXY"};

string trm[]={"Move","Trend","Move","Trend"};

string dxy[]={"EURUSD","USDJPY","GBPUSD","USDCAD","USDSEK","USDCHF"};

string exy[]={"EURUSD","EURGBP","EURJPY","EURCHF","EURSEK"};

string edx[]={"EURUSD","EURGBP","EURJPY","EURCHF","EURSEK","USDJPY","GBPUSD","USDCAD","USDSEK","USDCHF"}; // 10 pairs 

And about this:

I'm sure you don't understand what Mr. William Roeder explains on the topic Different results on use multicurrency indicator, therefore I suggest that you should behave like a smart person who acts stupid, rather than someone who acts smart but is stupid and doesn't know what to talk about.

I can only quote Oscar Wilde...

Sometimes it is better to remain silent and appear stupid than open your mouth and remove all doubt.

 
supersimon7583:

Are you under some drug effect???

This is from "your" code:

And about this:

I can only quote Oscar Wilde...

Sometimes it is better to remain silent and appear stupid than open your mouth and remove all doubt.

You are smart, the code is not what you think it is. ^_^

//Calculation

//The U.S. Dollar Index is calculated with this formula:

//DXY = 50.14348112 × EURUSD -0.576 × USDJPY 0.136 × GBPUSD -0.119 × USDCAD 0.091 × USDSEK 0.042 × USDCHF 0.036

//The ECX was the geometrically weighted average compared to these currencies.

//The formula for the calculation was 34.38805726 multiplied by the product of all components in the basket of currencies,

//that have been raised to a high number of their percentage, weighting equal to:

//ECX = 34.38805726 x (EURUSD^(0.3155) x EURGBP^(0.3056) x EURJPY^(0.1891) x EURCHF^(0.1113) x EURSEK^(0.0785))

double usdx=50.14348112; // Do not change for DXY

double eurx=34.38805726; // Do not change for EXY

double dxycw[]={-0.576,0.136,-0.119,0.091,0.042,0.036}; // Do not change for DXY

double exycw[]={0.3155,0.3056,0.1891,0.1113,0.0785};    // Do not change for EXY

The list of pairs of names is only useful for calculations on it, which you either don't think about or don't know.

 
Roberto Jacobs:

You are smart, the code is not what you think it is. ^_^

...

The list of pairs of names is only useful for calculations on it, which you either don't think about or don't know.


Maybe you confuse me with some <Deleted> here around but I'm a coder, so you can't be a liar with me. 

    string dxy[]={"EURUSD","USDJPY","GBPUSD","USDCAD","USDCHF"};
    string exy[]={"EURUSD","EURGBP","EURJPY","EURCHF"};
        
    int dxs=ArraySize(dxy); // <-- here are all the symbols counted for dollar
    int exs=ArraySize(exy); // <-- same for euro

    ...
    //--
   for(int i=barc; i>=0; i--)
     {
       usdidx[i]=usdx;
       for(int x=0; x<dxs; x++)
         {
           usdidx[i] *= pow(FillPrice(dxy[x],i),dxycw[x]);
         }
     }

   for(int i=barc; i>=0; i--)
     {
       euridx[i]=eurx;
       for(int y=0; y<exs; y++)
         {
           euridx[i] *= pow(FillPrice(exy[y],i),exycw[y]);
         }
     }
   //--
   for(int i=barc; i>=0; i--)  
     {
    
       FMADXY[i]=iMAOnArray(usdidx,0,MA_FAST,0,mameth,i);
       SMADXY[i]=iMAOnArray(usdidx,0,MA_SLOW,0,mameth,i);
       FMAEXY[i]=iMAOnArray(euridx,0,MA_FAST,0,mameth,i);
       SMAEXY[i]=iMAOnArray(euridx,0,MA_SLOW,0,mameth,i);
     }

And here is the FillPrice function:

double FillPrice(string symx,int shift)
  {
//---
    double inprc=0;
    //--
    switch(prc)
      {
        case 0: inprc=iClose(symx,percalc,shift); break;
        case 1: inprc=iOpen(symx,percalc,shift);  break;
        case 2: inprc=iHigh(symx,percalc,shift);  break;
        case 3: inprc=iLow(symx,percalc,shift);   break;
        case 4: inprc=(iHigh(symx,percalc,shift)+iLow(symx,percalc,shift))/2;  break;
        case 5: inprc=(iHigh(symx,percalc,shift)+iLow(symx,percalc,shift)+iClose(symx,percalc,shift))/3;  break;
        case 6: inprc=(iHigh(symx,percalc,shift)+iLow(symx,percalc,shift)+iClose(symx,percalc,shift)+iClose(symx,percalc,shift))/4;  break;
        case 7: inprc=(iOpen(symx,percalc,shift)+iHigh(symx,percalc,shift)+iLow(symx,percalc,shift)+iClose(symx,percalc,shift))/4;   break;
      }
    //--
    return(inprc);
//---
  } //- End FillPrice()
//---------//

Do you see the symx? Yep is the symbol of the previous array.

You wrote this code (sure :D), and you don't even know how it works!!!

In order not to make yourself further ridiculous, <Deleted> .

I'll not reply further, so have fun with your nonsense.


<Deleted>

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
Predefined Macro Substitutions - Named Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
supersimon7583:


Maybe you confuse me with some <Deleted> here around but I'm a coder, so you can't be a liar with me. 

And here is the FillPrice function:

Do you see the symx? Yep is the symbol of the previous array.

You wrote this code (sure :D), and you don't even know how it works!!!

In order not to make yourself further ridiculous, <Deleted> .

I'll not reply further, so have fun with your nonsense.


<Deleted>

It turns out that you can't tell the difference between an index indicator and a multi currency indicator.

To open your shortsightedness, here I will provide an example of a multi currency indicator image.

CSI

USDvs