Forum

Script to Open New Pending Order not always working

Hi All, I have put together the script below to open a new pending order with the same comment and magic number of an existing one. The script seems to be working fine most of the times but occasionally it will not open any order and there are no error messages are indicated in the Journal. Any

Emailing from Metatrader 4 no longer working

Hi All, In the last couple of days the emailing from the Metatrader platform has stopped working for me. Every time my EA tries to send an email I got a 'failed' message and this happens even when I try to send a Test message. Automatic emailing has been working well on 2 different accounts with 2

Howto retreive the details of the last open order

Hi Everybody, I am trying to retrieve the details of the last open order (i.e. not pending) , but the code below does not seem to work. Any hints? Thanks MG for ( int Counter= 0 ; Counter <= OrdersTotal ()- 1 ; Counter++) { OrderSelect (Counter, SELECT_BY_POS,MODE_TRADES); if

Trailing Stop for a grid: is it feasible?

Hi All, I am trying to setup a trailing stop for a grid which includes a series of orders (long and short) for the same cross. At the moment I can manage for the grid to close when a certain profit % has been hit, however what I would like to do is to create a sort of moving profit target loosely

EA reactivating themselves with one broker when MT4 starts again

HI all, I have a bit of an issue with just one broker as it seems that the last EA attached with a chart reactivates itself after havin been closed whenever MT4 is started. A quick example would help: EA is attached and running on one chart. During the day I stop the EA and detach it from the chart

CloseAll Function in an EA not closing all the orders

Hi All, I have an issue with the function below. It is part of an EA. When a certain profit is attained for a grid and for a specific cross, the fuction is called and is supposed to close all the current orders and delete all the pending ones for the specific cross. It seems to be working till a

OBJECTARROW - How to fill in the Arrow?

Hi All, I have the following code to insert a down pointing arrow in my chart string fibo_max= StringConcatenate ( "FiboMax" ); bool high_value_arrow= ObjectCreate ( 0 ,fibo_max, OBJ_ARROW , 0 ,date2,highest_value); if (high_value_arrow) { ObjectSetInteger ( 0 ,fibo_max, OBJPROP_ARROWCODE

How do I create a Comment Line in the Input Tab?

Hi All, Hopefully a quick question. How do I create a line of comments in the Input Tap of the Property Windows for the input variables. For example if I want to indicate that input variables below a certain line should be changed just in special market conditions? Thanks, MG

Fibonacci levels automatic calculation on MT4 - Sharing + Feedback

Hi All, I ma currently developing a script to automatically calculate Fibonacci level on MT4 based on how far back I want go on the history. In the spirit of collaboration I would like to share with you what I have so far. The purpose of the sharing is two-fold: - Hopefully some of you will find

Create a relationship between 2 Arrays - Most efficient way?

Hi All, Is there any efficient way to create a relationship between two (or more) Arrays that contain different data types? For example, I have an Array of data type string that contains several pairs (e.g. AUDUSD, EURUSD, EURGBP etc) and another array of data type int that contains the Magic