Forum

Getting Event date on MqlCalendar

Hello, I was wondering if is there anyway to acquire the date of the events from this function: void PrintCalendar() { MqlCalendarEvent events[]; //--- get EU currency events int count = CalendarEventByCurrency ( "EUR" ,events); Print ( "count = " , count); //--- 10 events are

Screening already read symbols in history and storing into array.

void GetHistoryPairs() { int find = 0 ; int i = 0 ; string symbol[]; for ( i= 0 ;i<OrdersHistoryTotal();i++) { if ( OrderSelect (i,SELECT_BY_POS,MODE_HISTORY)) { Print (" Symbol : ",OrderSymbol()); ArrayResize (symbol,i+ 1 , 0 ); if

Counting months elapsed since deposit

Hello, I'm trying to develop a telegram bot that sends a csv history for a desired lapse of time. Untill now I managed to make it send the history of last day, last week last month and total history. I was wondering. Is there any simple way to count months elapsed since deposit and fill an array

Preventing Expert Advisor from opening new charts MQL5

So I created an expert advisor to load custom charts and it works perfectly, what I'm wondering right now is: is there anyway to prevent OnTick event to open the chart for the desired Symbol everytime a new tick arrives? To do so my simple question is: is there anyway to count opened charts

Calculating Chart numbers for emergency measures

So I've created a simple EA that shuts the superfluous orders as soon as they are in profit as long as the orders number exceeds the maximum int granted. My code for now is this: void DeployErrorCloser(){ if (CalculateCurrentNonUserOrders( Symbol ()) > MaxOrderPerSymbol) { long Chart = ChartOpen (

Preventing expert advisor from opening positions too close to eachother on same signal.

So, I've been dealing with the recurring issue that my EA kept opening positions till the numeric block stopped it: if (CalculateCurrentOrders( Symbol ) < MaxOrdersPerSymbol) DoTrading(); else return ; so what i tried to do is making a bool function to put a red or a green light in a determined

Calculating the average value of a specific difference in mql4

Hello everyone, so i've been trying to create my custom indicator , but i'm having trouble creating the "iMaOnArray" of this calculation. What i basically wanna do is retrieve the average value of the difference between close price and LWMA(Linear Weighted Moving Average) when close price is higher

Expert Placing one pair stoploss on other pair.

Hello everyone, i've been having an issue with this function: what i'm basically trying to do is placing a stop loss on the opposite bollinger band when the OnTimer event occurs. The function works perfectly, except for the fact that the stop loss is placed on the wrong instrument when multiple

How can I make my Expert Advisor read cells from a CSV and return them as an int value?

Hello everybody, I'm trying to make my EA capable of assigning to an opened order in loss its specific hedging order so to avoid randomly opened hedging orders. To do that I was trying to create a blacklist, blacklist which I thought i could do by simply using the FileWrite() function . So I came up

Exempting order from orderselect once specific conditions are met.

Hello, while coding my brand new EA recently I came accross a quest. Basically i need to avoid orders which met a certain condition to be modified by my tick-bound modify function. So i thought about making it the way the expert advisor creates a sort of "Blacklist" with the Ticket numbers of orders