Forum

lower value than expected with iATR

Morning' everyone, I would like to get the value of the Average True Range Indicator (ATR). I tried to use the following code, but the value is way lover than the one given by the indicator. iATR ( NULL , 0 , 14 , 0 ); When I print, the value displayed is: 3.000000000000621 e-05. Any idea why

Disabling EA

Hi everyone, I wrote an EA that seems to not be working all the time. I do not think the code is the problem so I was wondering what are the current technical problems that may cause an EA to stop working. 1/ Is it possible that after a certain number of tests, the EA needs to be restarted? 2/ Is it

making a loop with bar

Hi I would like that each time there is a new bar formed, my EA checks some instructions. So I wrote that: count1 = iBars ( NULL , PERIOD_D1 ); count2 = count1; while (etape == 0 ) { count1 = iBars ( NULL , PERIOD_D1 ); if (count2 =! count1) {

How to remove the EA once the trade is taken?

Hi everyone, I would that once the EA took the trade, that the EA is removed from the graphic charts. I tried to use ExpertRemove (); But MT4 has crushed each time I used the EA using the ExpertRemove() function . Here is the code I am using: if (condition d'achat) { while ((buy == - 1 ) &&

OrderClose >> some operator expected

Good evening to the mql4 community, I was trying to modify an open position, to close 80% of the position to be precise. And with those instructions an error message appear : "some operator expected" if ( MarketInfo ( Symbol (), MODE_BID ) <= profit) { if (

Check the name of the base currency

Good evening everyone, I would to code something corresponding to this sentence "if the currency pair on the current chart is one of those : USDJPY or EURJPY or CADJPY". Is someone can help? Luciole

Lot size

Hi everyone, I aim to code something saying that only 80% of the position will be closed when reaching TP1. I am scared that the value will not accepted by the broker. Ho to tell the EA to choose a value around 80%.. Do you have any suggestions? or link to help me through this step. Thanks for you

Can i call the period in the program?

Hi everyone, Thanks in advance for you help. I have 2 questions 1. I was wondering if I could write something like : if Period_CURRENT = PERIOD_H1 {... } if Period_CURRENT = PERIOD_H2 {... } 2. I have an additional question: the PERIOD_M40 do not exist right? Thanks again, Luciole

Quick question on iBands - Bollinger Bands indicator

Good morning everyone, Is someone can help me understand the difference between : bands_shift [in] The indicator shift relative to the chart. shift [in] Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago). Thanks a lot for your

EA for the indices such as the Dow Jones or the DAX30

Good morning everyone, My EA works when I use it on the EURUSD but not for the indices such as the Dow Jones or the DAX30. Here is the code I use to send an order to buy: int buy = OrderSend(Symbol(), OP_BUY, lots, Ask, 4, Ask - (stop * Point), Ask + (profit * Point), "Ordre Achat Scalping", magic