How can i add USDX to Expert Advisor ?

To add comments, please log in or register
cuneytates
44
cuneytates  

Hi guys,

I want to add USDX to my EA.

How can do that without adding custom USDX(DXY) indicator to my EA?

Any help?


*** Below there is my EA's structure




//+------------------------------------------------------------------+

//|                                                   cuneyttest.mq5 |

//|                        Copyright 2018, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+


#property copyright "Copyright 2018, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

#property strict





int ergodic_ticks_volume_osma;


//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+

int OnInit()

  {


  ergodic_ticks_volume_osma= iCustom(sympol,0, "ergodic_ticks_volume_osma");

   

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Expert deinitialization function                                 |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void OnTick()

  {

   if(run_for_all_symbols)

     {

      for(int i=0;i<SymbolsTotal(true);i++)

        {

         sympol=SymbolName(i,true);


         checkTimeControlAndProcess(i);


        }

     } else {


      sympol=Symbol();


      checkTimeControlAndProcess(0);

     }

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void checkTimeControlAndProcess(int index)

  {

   orderNumber=getOrderNumber();


   if(orderNumber!=0)

     {


     }

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

void tickProcess(int index)

  {


   

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

   int getOrderNumber()

     {

      if(PositionSelect(sympol)==true)

        {

         return PositionGetInteger(POSITION_TICKET);

        }


      return 0;

     }

     

     

//+------------------------------------------------------------------+

//|      Satış bölgesi                                                            |

//+------------------------------------------------------------------+

   

   

   void orderClose(int index)

     {

     

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

   void closeCurrentOrder(int index)

     {

   

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

   void openOrder(ENUM_ORDER_TYPE type, int index)

   

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

   

Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
Ask questions on technical analysis, discuss trading systems and improve your MQL5 programming skills to develop your own trading strategies. Communicate and share your experience with traders from anywhere in the world, answer questions and help beginners — MQL5.community is developing along with you. Strange Issue .TP is set below Buy order...
Sergey Golubev
Moderator
115592
Sergey Golubev  

Forum on trading, automated trading systems and testing trading strategies

When you post code please use the CODE button (Alt-S)!

Use the CODE button


To add comments, please log in or register