Download MetaTrader 5
To add comments, please log in or register
Post web links to other trader's signals and make profit
trader201
404
trader201 2014.06.18 19:58 
What is the general structure of an EA?  

What is wrong in that code? How it is done correctly?

when I do the testing, using  "Print (" error ", GetLastError ());" it say "error 4054". But when I give opening that message, the txt says "Error 131".

I'm doing this:


void OnTick()
  {
   double TEND1, TEND2;
 
   TEND1= iADX(NULL,14,PERIOD_M15,PRICE_CLOSE, MODE_PLUSDI,1);
   TEND2= iADX(NULL,14,PERIOD_M15,PRICE_CLOSE, MODE_PLUSDI,2);
  
 
 
//---
   if (OrdersTotal()==0 && TEND1>TEND2)
      {
      int ticket=OrderSend(Symbol(),OP_BUY,0.01, Ask, 10, Ask-500*Point, Ask+500*Point, NULL, 0, 0, clrNONE);
     
      }
   Print("error", GetLastError());
  }

qjol
3243
qjol 2014.06.19 01:25  
   TEND1= iADX(NULL,PERIOD_M15,14,PRICE_CLOSE, MODE_PLUSDI,1);
   TEND2= iADX(NULL,PERIOD_M15,14,PRICE_CLOSE, MODE_PLUSDI,2);
whroeder1
13593
whroeder1 2014.06.19 01:29  
trader201:  What is wrong
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. Don't double post
/
To add comments, please log in or register