MQL4 and MetaTrader 4 - page 1423

so if you want to use the average range of the last 1000 bars of the current chart: sum(high-low)/n, how would you code this to use as a variable in your code? This would need to be adapted somehow.. for(int i=0; i<limit; i++) { CurrentHigh = iHigh(NULL,0,i); CurrentLow = iLow(NULL...
Dear Sir, do you know some code for calling price close at specific time? exmp; extern string Asia_Open = "02:00"; extern string Europe_Open = "08:00"; extern string LONDON_Open = "10:00"; extern string US_Open = "15:00";...
  lessons  (1)
MetaTrader programming lessons Live trades every day Backtest
[Deleted]
Moderator, has it been pulled ?
[Deleted]
Dear Sir or Madam: I met a difficult problem when using MQL4 programming. I will deeply appreciate if you can offer me some suggestion, clue, or a solution. Thanks a lot. The problem is: how to update realtime and historic data with a MQL4 program. I need the latest data of at least 100 bars,...
  New Biggest Problem  (15   1 2)
//+------------------------------------------------------------------+ //| nnnn.mq4 | //| Copyright © 2009, MetaQuotes Software Corp. | //| http://www.metaquotes.net |...
[Deleted]
I'm trying to create an EA that will place a pending order X pips above the ask price. For example, on the daily EURUSD chart it checks when the price moves above the bar moves above a moving average and then sends the pending order 20 pips below the MA, i.e.; Ask: 1.42211, Buy would be 1.42231. Now...
[Deleted]
Hi, I've been customizing a Pivot Points indicator and I think I need to get the calculations in a different way. The indicator uses a variable to set a "hours shift" from the server. For example: I use a server that show me the charts in GMT hour, so I set the indicator to calculate the pivot...
[Deleted]
Hi All, Firstly, I would like to thank all the people who have helped others such as me.... Complete newbies! I have spent the last month or so using the forum to teach myself this MQL malarky but have now encountered an issue which is confusing me no end; MagicNumbers. I'm not looking for the code
[Deleted]
I developped an EA that out of 40 months historical data, tested month for month, on one broker (FXDD) shows 50+% profit/month. The mystery is that on another broker's hitorical data (that looks the same) (FXCM in the case) it performs utterly different, even with loss. How can 2 different broker's...
[Deleted]
I am trying to code a module into an EA that would automatically take ascreenshot at each trade. Anybody knows how to do that and can guideme? I would appreciate it very much.
[Deleted]
Hi, I have been trading forex for like a month (not long enough to make any assessment of my trading ability) and I have been messing around with EA's and doing stratagy tester on them and some of them get unrealistic gains in the stratagy tester for backtesting (like turning 10k into 100k in a...
Do banks control modeling quality? Or is it the MT4 finction? I used M5 frame and the EA was pretty successful on the old data (25% quality). But it stops being successful and begins to lose when I test it closer to modern data. Long research, but I found the dates of switch. In February 2009, the
[Deleted]
Hi, Im working on an EA (really just leaning how to program in MT4 ) And I had an idea and I want to know if its possible. First let there be a condition and the EA opens an order With no SL or TP (I know this is not practical, but bare with me) OrderSend(Symbol(),OP_BUY,1,Ask,3,0,0,"Well Placed...
[Deleted]
I just started live trading...I trade using the crossing of two lines...being 1. Time series forecast "TSF @ 13 period" 2. xpma 8 @ period I would be very very grateful to anyone who can make me an alert signal indicator, which will alert me whenever the two lines cross over.. 1. it should show an
[Deleted]
Is there a way to have an EA look at the last trade and see whether or not it was profitable? If it was profitable, I'd like it to take one action, and if it lost money because it hit its stop loss, I'd like it to take another action. Any ideas on how to do this? Perhaps one global variable that...
Hello, What I'm trying to do, is calculating the average price change in lets say the 10 last ticks. Does anyone know how this could be realized? Thanks in advance, Eggat
[Deleted]
I've got a Braintrend indicator that is set to alert whenever a braintrend dot is drawn, however, the dot repaints during the course of a candle and I only want alerts when the Braintrend is set, so the candle after. How can this be done?...
Hi, I'm trying to have the same history data on EURUSD on two different computer. The 2 platforms are from the same broker. One is the one I am using since a few months and the other is just a new one I have just installed. At first I have downloaded the eurusd history with the DOWNLOAD button but I
Is there a way to check when an order closes whether it hit it's stop loss or take profit? How do youm know when it has closed to trigger some code?
[Deleted]
My Forex Monster demo account started with $3,000 in it but has now got down to just $352.71. I think it is no longer tradeing in sim for me because the funds are so low in my account as I can see arrows for trades being taken but no trading occuring in my trade area. How can I increase my demo/sim...
[Deleted]
Its probably silly problem for somebody... but I am unable to make function to act following: Beginning: indicator1 value=0 indicator2 value=0 A=0 Step1: indicator1 value=1 indicator2 value=0 A=1 Step2: indicator1 value=0...
Starting August 2, 2009: http://www.fxsolutions.com/learning-tools/tutorials/nfa/fifo.asp I heard that the platform Meta Trader 4 is not compatible with the NFA. Why is that? Will made some moves in that direction and when? If not, the days of the MT4 platform are counted because of the major...
[Deleted]
I want to calculate the slope of a line that is Perpendicular to a known line: Line A is Perpendicular to line B; Slope of Line A: SlopeA = (Price1-Price2)/(bar2-bar1); Because Line A is vertical to line B, So: SlopeA*SlopeB = -1; Therefore: SlopeB = - 1/SlopeA = - (bar2-bar1)/(Price1-Price2);...
[Deleted]
A stupid oscillator that i want to show the result of the range variabile... If the range a 5days today is 140, mark a line there, if tomorrow will be 150 mark a line there and so on.... i had fixed the top and the bottom at 120 and 250 how i can do it...because not appear nothing in the indicator!...
[Deleted]
My expert keeps create, open CSV file, and writing the data line in CSV file. When I open the CSV file I find that the data line was written and repeated many times. Please tell me how to solve this problem?
[Deleted]
  How to protect my EA??  (11   1 2)
Hello How can someone protect an EA? For example: If I have an EA I want to sell but don't want people to be able to see what it is made from and / or change anything in it. Thanks!
I wrote an EA to place orders from an email signal service and subsequently manage the orders afterwards. However any attempts to partially close orders and take profit at predefined levels have so far been impossible. Iam using the OrdersSuite.mqh file available here which includes all error...
[Deleted]
I am trying to do a few different types of trades that will execute without me being there. 1) A trade order that triggers when a certain criteria is hit. For instance, if eur/usd is at 1.3990. Once it goes past 1.4000 to 1.4015, I want a trade to be triggered to buy at 1.4000 with stops and...
[Deleted]