Forum

How to modify external variable

Hello external variable like bool if i selected manually to one of 2 cases and from program inside i want to reset it as if i remove the EA and attach it again on chart external bool Run= true ; int start() { if (!Run) { Run= true ; } return ( 0 ); } That is example if i click on Run on

How to Disable / Enable Expert programmably ?

Hello I want to Disable / Enable Expert (Auto Trading) button programmably as if i click on it to enable or disable Expert according to condition. I am searching MQL4 code to do that but i did not find. Any help please

How to get Initail Deposit

Hello I want to ask how to get initial deposit of an account to calculate some values in my EA

comparing with greater than to take order?

Hello I am thinking on making compare current price with greater or less than fixed points to enter transaction one time. Example: int Difference= (( OrderOpenPrice ()- OrderClosePrice ())/( Point )); if (Difference== 20 ) { OrderSend ( Symbol (), OP_SELL ,LotSize, Bid , 3 ,( Bid +SL* Point ), Bid

How to modify magicnumber ?

Hello i want to make EA that depends on magic number for closing a group of orders but, i want the first order to take its ticket as magic number and that order will be the master of 3 orders and the 3 orders will take the first magic number of the first order. Example: int Tic Tic= OrderSend (

How to increase max total orders in backtest ?

Hello when i make backtest for EA and total pending orders and orders exceeded more than 200, broker gives error in journal 148 148 mean "The amount of open and pending orders has reached the limit set by the broker." so how to avoid that to complete backtest as i want and increase total orders more

what is return(-1), return(-2) and return(0) mean

Hello sometimes i see some EAs have return(-1), return(-2) and return(0) as we know it returns nothing, but what about return(-1) and return(-2)? as in the article here https://www.mql5.com/en/articles/1355

indicator to draw short lines

Hello I am trying to make daily pivot indicator to draw short vertical lines, but i want to draw it not using objectcreat() function but using indicator functions. Precisely, i want how to draw a vertical line between 2 candles stick and the lines are discrete not continued. Any codes to help

No Error message with GetLastError()

Hello I am building simple EA for showing Error messages ans numbers as test. The following codes open 2 orders buy and sell, the buy has a big lot 150 and that is so big and when i do it manually it gives me error not enough money , but when i do it as script the error gives 0 and that means there

Refresh rates when EA attached

Hello I made EA for trading with day range and it is working as i want. It is depending on daily range and takes the high and the low of day candle, i attached the EA on 1H TF and takes the day H&L using below instruction, but i noticed something, when i attache the EA to 1H TF as example on any