Forum

Check if another Order were closed

Hi Guys, in my current EA I need to find out if a new order were closed. It doesn't matter if it's closed by hitting TP or SL... At the moment I use therefor: bool NEW_CLOSE() { bool new_close = false ; static datetime close_time = 0 ; for ( int i= 0 ; i<=OrdersHistoryTotal()- 1 ; i++)

Find OrderOpenPrice closet to current Price-Level

Hi, I need a function where I can find out the OrderTicket() or OrderOpenPrice() of the order, that is the most closet to the current price-level (e.g. price-level = (Ask+Bid/2) ) I'm currently creating a kind of Grid-Trader thanks for any help or hint

Loop for most profitable order

Hi guys, I try to code a function, that always return the orderticket for the order, which is currently the most profitable. Attached you can find my code, but there seems to be a problem, because if the most profitable order is colsed, the function will still return the same orderticket as most

MQL4: Issue with bool after OrderSelect()

Hi to all, hope someone in the english section can help me. I try to create a GRID-EA. For the following problem I will use the assumption just trading long. 1. Step: using an input variable to define the gridsize --> Grid_Abstand = e.g.: 200 2. Step : find out the current price-level on the chart

Get lowest double Value out of Array

Hi Guys, I would like to use an ATR to define a StopLossArea, afterwards I would like to search for all Bars/Candles that are crossing this StopLossArea. In the next step, I would like to get the LowestLow from those crossing Candles as my final StopLoss. Unfortunately I'm not sure how exact I could

Code for last OrderTicket in TP

Can someone help me how the correct Code is, to get the OrderCloseTime from the last closed Order with TakeProfit

Bug in OrderClose --> OpenOrder circle

Hi, can someone help me please? Need some code for following case: "If EA gets his signal, open for example BUY + SELL STOP order If one of both runs into TP, close all other open orders." As soon as there are no remaining orders on the chart, restart again with above mentioned flow..., means wait