I need a EA basic, can you help me?

 

Hello, I new member and i learn MQL4 but i don't start where? I need a EA basic can you help me?

Thanks for much

 
Plenty of EAs here: EAs for free
 
walking:

I need a EA basic can you help me?

Since reading your post I have written this EA, just for you. Tested and working.

// ONLY run in a DEMO account
int ticket=  -1;
int counter = -1;

bool abort =false;

//----------------------------------------------------------------------+
int init(){
   if( abort )    // if you don't do this then changing the chart timeframe will re-run the init, which is bad in this case
      return( 0 );

   double lotSize = MarketInfo(Symbol(), MODE_MINLOT);
   ticket= OrderSend(Symbol(),OP_BUY,lotSize,Ask,10,0,0);

   if( ticket< 0 ){
      Comment("Failed to Buy: Reason " + GetLastError());
      abort = true;
      return(0);
   }
   
   counter = 20;
}
//----------------------------------------------------------------------+
int deinit(){
   Comment("");
}
//----------------------------------------------------------------------+
int start(){
   if( abort )
      return( 0 );
      
   if( counter <= 0 ){
      if( OrderClose(ticket, OrderLots(), Bid, 10) ){
         abort= true;
         Comment("successful close");
         return( 0 );
      }
      else{
         Print("Order failed to close: reason " + GetLastError() );
         Comment("Failed to close " + counter ); 
      }
   }   
   
   counter--;
   
   if( OrderSelect(ticket,SELECT_BY_TICKET) )   // You have to KEEP order selecting to get the latest data
      Comment(counter + "\nOrderProfit is " + DoubleToStr(OrderProfit(),2));
      
   return(0);
}

Go to the MetaEditor, select the menu File | New

the radio button ExpertAdvisor should already be checked.

Go next

Add the name, for example

Basic

and there you have your own blank EA.

Copy and paste the above code over the top of the code provided by the wizard, completely replacing it.

You can then compile and run it in a demo account.

 
Thank you for much. I want learn it,
 
walking:

Hello, I new member and i learn MQL4 but i don't start where? I need a EA basic can you help me?

Thanks for much


Hello walking! you can EA basic at mt4appstore. All are free.

 
walking:

Hello, I new member and i learn MQL4 but i don't start where? I need a EA basic can you help me?

Thanks for much

Hi walking,

Just read the book.

 
walking:

Hello, I new member and i learn MQL4 but i don't start where? I need a EA basic can you help me?

Thanks for much

Hello walking! I am also trying to basic knowledge on EA and studying on mt4appstore.
 
nurulbd:
Hello walking! I am also trying to basic knowledge on EA and studying on SPAMStore

Perhaps you missed this when you registered . . .

Look here: https://www.mql5.com/en/users/register

It says . . . "4. Posting of advertising messages is forbidden. "
 
onewithzachy:
Just read the book.
or lessons
Reason: