MQL4 and MetaTrader 4 - page 447

Hi, I am trying to learn how to create a simple robot. Basically as an example I want it to buy when the daily price closes above a MA (144 as example) and then close when the closing prices closes Below the MA, but when I test it I don't get any trades and I get the following 2018.05.24 16:24:56...
[Deleted]
  Get Computer Name in mql4  (24   1 2 3)
Hi, I want to get computer name in mql4 in order to make original log file including computer name which MetaTrader runs. I think it is possible using GetComputerName function in kernel32.dll, but I don't know how to implement it in mql4. I found a kernel32 api example and modified it, but it...
hello , can any one help ?   i have an indicator in seperate window, i want modify it so it can load on main chart window .
Hi! Would like to ask for your opinions and comments on the structure of the following code.  My main concerns are as on the: 1. The code is a template. The specifics of Open & Close conditions are negligible. So are the values of extern variables. My main goal is to create a template where I can...
Hi The following is getting me a "Possible loss of data due to type conversion". // Now retrieve all stylescolor  Color1   =         ObjectGet(Label1, OBJPROP_COLOR); But I can't get it: what could this ObjectGet give other than color data?
Hi guys Iam trying to write an EA that opens trades on USDJPY based on  values Nikkei (JPN225 is the CFD index in mybroker). The EAcollects data on the data of the Nikkei during the day     Nikkei_Open=iOpen("JPN225",PERIOD_D1,0);    Nikkei_Close=iClose("JPN225",PERIOD_D1,0) When I runit on backtest...
It occurs when I call EventSetMillisecondTimer() and once it happens, the whole EA goes down. The only official documentation I found is this: https://docs.mql4.com/eventfunctions/eventsetmillisecondtimer. There's, however, no detailed description of a proper usage of this function nor how to...
Dear Any Programmers, I need help fixing this code At the moment only the Add Missing Stop Loss is working. I need to Add Missing Take Profit to be working aswell. Below is the specific part of the file I need looking at. Thank you void InsertTakeProfit(int ticket) {       //Inserts a take profit...
[Deleted]
Can anyone provide the code to make sure only one trade per pair is opened at time? I have an EA that places market orders, but it places multiple trades as long as the conditions are met. I only want one trade per pair opened at a time. For example, once a short GBPUSD is opened, then as long as...
Hi all, I need help as follows: 1) There are numerous Objects in the chart, I am interested to get value of the object on a specific bar of the chart.  2) Object with the names, as an example, "XYZ04", "XYZ110", "XYZ005"  appear on the chart, therefore I know the prefix, but I do not know the suffix...
My indicator (Pivot Lines) are not showing up on chart when selected - is there something I can do or something I can udo to get them to work again. They were taken of my chart when the computer reset - now they will now go back onto the chart
Hello,  I have some issues regarding 2 array for storing horizontal lines. This is the code, it shows  Trendline EA 1.4 EURUSD,M15: array out of range in 'Trendline EA 1.4.mq4' (108,50).    int linB=0,linS=0,B=0,S=0;   for(int i=0;i<ObjectsTotal();i++)     {      objectname=ObjectName(ChartID()...
hello ... I work on an indicator and I try to play with candle hammer I calculate it the following way in the code, my problem is in the loop inside the first loop I want when the price comes back to the opening of candle the indicator gives an alert My code :    int i,limit,x=-1 ;...
i have 28 terminals mt4 on my pc; each time I have an update of EA, I must paste It on each one of 28 terminal folder at mql4; is there anyway for paste it just one time at all mql4 folders? or any other way to make it more usefull? tks
Hi, I coded a simple expert that open an order (BUYLIMIT or SELLLIMIT) when the price reach a certain level that define, I run it monday and it worked perfectly, But today I run it and it doesn't work despite that I didn't change nothing in the code, and I try it on many brokers but the problem...
Hi Guys, I have a question, and I cant quite find the answer. When I sort an array,for example ascending, do indexes keep or they rearrange? Thank you in advance !
Can someone help me code this script a a daily open line indicator? Would really appreciate it. Thank you.
Hey everybody, my indicator draws lines on the chart and on every new day I want the re-initialize the indicator again. In the OnCalculate() function I will put the following: OnCalculate(const int rates_total,      // size of input time series                 const int prev_calculated,  // bars...
Hi at all, I use MetaEditor when i work from my personal work station, repository type git, on bitbucket .com. But MetaEditor save file mq4/mqh ecc ecc as binary type ???? No in text type ??? After working, i must create a file .txt, put all code inside, create a new name (es.: myWorkEA_last.txt )
Can someone show me how to show the transaction spread in MT4? I would have expected it to be in the "Account History Detail Report" but it is not there.  They show Swap and Commission but there is no column for Spread. The Profit shows but my broker says the spread is already subtracted.  How do I...
Hello, I want to print the multiple and different datetime values in the Data window I started using the SetIndexBuffer but it only works with double values and it worked fine for double values What is an equivalent function to work with datetime values instead of double, so I can see those values...
Salutations! So I was tinkering with my trailing stop code template, which kinda is as follows:          if((OrderType()==OP_BUY) && (OrderSymbol()==Symbol()) && (OrderMagicNumber()==MagicNumber))  /*This*/       if((TrailingStop>0) && (Bid>OrderOpenPrice()+MyPoint*TrailingStop) &&...
hello i got an indicator which the only way to retrieve buy and sell signals from is to analyse log Alerts produced by the indicator. i've tried every other way. But i *need* to automate it. my question regards the correct way to open the log file and to analyse it. 1) is it possible to open the log...
Hi, does anybody knows ho many pixel in x-direction (size_x) does have one candle of the chart with chart_scale 5 (and 4,3,2..)? Is there a way to calculate the size_y out of the High[iHighest(..)] and Low[iLowest(..)]? Thanks in advance, Gooly PS: I didn't find anything but the descr. of...
Hello everyone, I wanted to ask how I can set up an ea to open operations only from one hour to another. For example, I would like you to open long or short transactions only if a maximum or a minimum is broken between 2 and 3 pm
I do not know where to ask but ... being in with MT5 for the last few weeks - I am really confused - why some very good coders are ignoring MT5? Just because MT5 is more developed and people are having more possibilities to make money while trading? Or because of different programming language for
I am looking for MT4 client terminal... But find nothing yet...! Is that really available...? Not asking about Mt4 server API...!!!
Hello Guys, I am getting error 138 (requote) only in backtesting it looks to be fine in demo acount. any clue? here is my code: #include <stdlib.mqh>int ID = 1111;bool ShortIsOpen;bool LongIsOpen;int ticket;extern double Lots = 0.1;int slippage = 3;int order;int to;int init(){   ShortIsOpen =...
[Deleted]
I have an expert advisor which is not working right. Adding and changing some features
Hi guys Please help me with this code. The expert opens a buy position and then SellStop. But if there is manually open Positions (market or pending) . the Expert stops working even though I did selected the orders with magic number in the Loop What's wrong in my code ??? I do not expert to deal...