Forum

cancelling one pending order when another one gets triggered

Hi, Sorry for probably an easy question but I just started learning how to mql5. Let's say I have two simple pending orders, a long and a short, waiting to get triggered trade.BuyStop(0.1,longpriceentry,_Symbol,LTP,LSL, ORDER_TIME_GTC );

Performing a function after a change in value of a variable

Hellow, I hope somebody can help me :) I am storing a counter value in a variable. Each tick the value gets checked . For each time the value of the variable changes I want to perform a function. For example : variable = 0 variable changes to 1 > call to perform the function (one time) variable

Knowing when certain orders are triggered

hellow, Probably this is a newbie question but here we go. I regardless the discussion whether this is a good idea or not, what I want to do is the following as below : Instead of a stoploss, once my long or short order is triggered I want to set a sellstop (in case the long order is triggered) or a

Flagging open orders by comment

Hi, Let's say I have 6 pending orders , tagged with a comment. At a certain point I want to check which ones have been triggered by reading the comment on the positions. The ones which are triggered I want to flag off. I wrote a small function which runs through all open positions, reads the comment

check OP_BUY by Magic, in a pending order pool of 5, and replace the unopened pending orders with new ones.

hi everybody, I have (for my mind) a bit more of a complex solution. 1. I open a grid of five pending orders . 2. at some event i take all unopened orders away, so the ones which haven't been triggered 3. at another event I want to put the five pending orders again, apart from the ones which were

adding to array

Hi everyone, For the first time i would like to use an array in my EA but i have no idea how to do it. I read a lot about the topic but I still don't understand how it actually works so I hope someone could be so kind to give me a push in the right direction. what i want to achieve : At the close of

Plotting a series of dots

Hi, Just testing to draw dots on the chart in its simplest way. So i wrote this simple piece of code : void OnTick () { SetParameters(); static datetime bar_time= 0 ; datetime this_bar_time= iTime ( Symbol (), PERIOD_M1 , 0 ); if (bar_time!=this_bar_time) {

Only check price (or do certain actions) after each candle close

Hi, Probably newbie question (that's what i am), I would like to do certain actions (like check price, change variables) based on Candle close actions rather than on each tick. Could somebody provide me with sample code or another post for me to learn. Found some topics but i'm confused It would

Checking actions on a higher timeframe

Hi, I don't know whether this one is possible : Let's say our EA is doing trading operations on the M15 chart. Can we check for example the 200MA price & direction on the D1 within the EA, knowing it is working on the M15

Invalid volume size

Hi, I have a problem with invalid volume error with lot sizes over 200 lots, but my balance is 324 lots. How could I avoid this? Thx