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.
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.
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
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. "
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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