Download MetaTrader 5

MQL4 and MetaTrader 4 - page 1003

To post a new topic, please log in or register
hi,I'm trying to get the open time for current order by using this code :int orders, total, j;datetime Open_Time;orders = 0;total = OrdersTotal (); for (j = 0; j < total; j++) { OrderSelect (j, SELECT_BY_POS, MODE_TRADES); if (OrderMagicNumber() == Magic && OrderSymbol()...
hi guys!i need help from you guys to guide me, what is this mean :for (order = 0; order < OrdersTotal()-1 ; order++)what I don't understand is, what is the purpose of OrdersTotal()-1?why orderstotal minus 1?your help is much appreciated.thanks in advance!
  EA Programming (35   1 2 3 4)
hi fellow traders, since I didn't find any forum rules which forbid this kind of offer I am gonnapost it. However, if Admins consider this to be inappropriate just remove the thread. I've been trading quite a while (a few years) and been programming EAs and indicators(and other programs for even...
Hi I have created a custom indicator that already uses 6 of the available indicator buffers. I want to set defaults for the following (from the indicator code): Chart Type = Bars bardown_color = Red Please can someone advise me how to default the chart type to bars AND make the bardown_color set...
Hi I am currently using MT4 with time zone GMT+2, but I want my charts to reflect New Yorks close, Is there anyway I can change this? thanks.
Suppose I have an EA (or an indicator) running on EURUSD chart can I get price data of other symbols like GBPUSD, USDCAD, NZDUSD, AUDUSD, USDCHF and USDJPY from the same EA. What I meant is eurusd = iClose("EURUSD", PERIOD_M1, 0); gbpusd = iClose("GBPUSD", PERIOD_M1, 0); audusd = iClose("AUDUSD",...
hi all, can anyone explain, what is the difference, or what does on line do, what the other do not? sorry i'm not a coder, but very interested to understand. thanks in advance extern int LongEma=50; double LEMA1=iMA(Symbol(),0,LongEma,0,MODE_EMA,PRICE_CLOSE,i+1); double LEMA2=iMA(Symbol(),0,LongEma...
  Font Settings (2)
How can I change Font Settings in MetaTrader 4 ?
  Box Break Out (5)
Box Break Out
I am seeking help from the users of MQL4. I am a new trader. Can I do equity (stock)trading or futures/commodity trading or both with MQl4 as my trading platform? When I downloaded MQl4, it is defaulted to support only Forex Trading. I would like to use "Brain Trading System", a...
Some languages don't work well when a function's value is returned from within a loop (in our case 'for' or 'while' loop). I have done some test scripts and I haven't found a problem with that in MQL4, but I'm not sure... Can I return a value from within a loop safely?
How do I set certain currency pairs to start and stop trading automatically (except for open trades) at a certain time? Any help would be greatly appreciated. I wish to accomplish the following: Currency Pair A USD/JPY, GBP/JPY, EUR/JPY, EUR/USD Trade from 5:30AM - 12:00PM (+0800) Currency Pair B...
Hi everybody, as we know gpwr posted an indicator based on back-propogation neural network which was applied to moving average. I'm trying to build an EA using this indicator, but the problem was raised on backtesting. When you apply an indicator, the network only uses some amount of bars to train...
Hello, While this newbie still struggles to design the holy grail, if some experienced friends could share their thoughts on this question. I do not want to design something that works fine on demos but is bound to fail on real accounts. Appreciate your help. regards Sat
Hi, This is a MA indicator that is reading MA off a higher TF and used in a lower TF... In its current state the line appears as a staircase, drop it on a 15M TF and you'll see. I want it smoothed so that there is a distinct change for every low TF bar, iMA can be used as suggested in the code but I...
Hi all, Just released one of my most promising expert advisers as open-source code. Download .ex4 and source code at www.tradeharmonics.com/GoldenEA.zip It's not perfect, but back-tests very well and live demo testing has gone well so far. Can't wait to see what some more talented minds than mine...
I am having no luck finding or understanding a way to filter out less than desirable trading hours. My brokers GMT is 0 if anyone can help me with a a conditional statement to add in hours filter. Also I have a signal that is highly reliable under certain conditions but dont want to open trade at...
Hi, I'm fairly new to using MQL4. I've been trying to write an EA where a buy trade is opened if RSI(14) goes above 55, Momentum(14) above 100.2, sells if RSI(14) goes below 45 and Momentum below 99.8 with a take profit/stop loss of around 50pips. I've programmed this but I haven't been able to stop...
I'm somewhat of a VB convert to MQL4 and am trying to figure out some demo code that I found. I'm running back testing with this piece of code, and have noticed that sometimes my stop loss doesn't seem to set at all.....it will enter into a position and just sit there, sometimes for days, and then...
Hello, my name is Andy and I'm a computer engineering student. This is my first meta4 expert adviser program, can anyone tell me whats wrong with it. Function. Its an EMA 9.33 program, its supposed to open only one position at a time and this happens on signal cross....
I'm sorry if this has been answered already,  I did look but didn't find it. I have coded a few simple indicators and scripts.  I have 2 platforms that I use and one shows an extra decimal pace compared to the other,  e.g. GU  1.5129  vs  1.51294  What I would like to do is be able to modify my code...
I wrote a small script to learn how to use FileRead and FileWrite. FileWrite works OK, becauseI can open the resulting CSV file in NotePad to see the data. The problem is reading the data back into MT4. The script has an Alert in it so I can immediately visualize the data read back in. Only some...
G'day again. I'm wondering if someone could kindly add an MA cross to the following code: extern int TakeProfit = 155; extern int TrailingStop = 55; extern int StopLoss = 55; extern double Lots = 1; extern int magicnumber = 777; extern bool PolLots = true; extern int MaxOrders = 12; int prevtime;...
Hi, I am having problems coding my first custom indicator. ye i know this forum gets a lot of these posts, sorry =(. Basically, what I am aiming for is for this indicator to give me a certain probability, so to speak, of what the how the next candle will behave--based upon the data that I have...
When referencing terms, sometimes it is said "Line index must be from 0 to 7. What is "line index" and what is each number mean (0 to 7)?
I can provide further informations for developers. I happen frequently. So you can easily recreate problem. There has been a critical error Time : 2009.11.13 19:29 Program : Client Terminal Version : 4.00 (build: 225, 10 Jul 2009) OS : Windows XP Professional 5.1 Service Pack...
I have just found what seems to be the solution to my Error 131 problem and thought I'd post to possibly help others. The details are as follows: The Robot uses a number of settings that seem to need to be adjusted as follows: 9this may help other people/robot settings): Acconut size - $100,000...
  return(0); (5)
Hello everyone, I'm still learning how to code, can somebody explain the meaning of the function, return(0); in an EA code.? and how does it affect closing of opened orders? any help will be highly appreciated. thanks.
Hi everyone, Is it possible to get the original stop loss value for an order that has been modified several times (ie. trailing stop)? Thanks, Chris
I read that the files with historical info for metatrader5 are smaller. I am guessing the HST file header description changed. Would you mind and share the new format specifications? Thanks em