Download MetaTrader 5

MQL4 and MetaTrader 4 - page 784

To post a new topic, please log in or register
is this code ok? (bool variable in declaration and in the code). Am I saing here, correctly, trade if sma20>sma40? here is the code: double ma20=iMA(NULL,0,20,0,MODE_SMA,PRICE_MEDIAN,1); double ma40=iMA(NULL,0,13,0,MODE_SMA,PRICE_MEDIAN,1); bool mas=ma20>ma40; if (mas=true) { ordersend(...); }...
I'm having trouble creating EAs because, for some reason, the OrderSend order does not work. I have tried a number of very simple EAs, using different signals, etc., and all do not work, citing a 130 execution error. Below is one of the EAs that have had this problem. I feel stupid because I am...
Hallo, I have programmed an EA with an iCustom-Function with 10 different Parameters. This iCustom-Indicator is calling an MTF-Indicator, which is calling an Indicator from my standard-metatrader-account. The backtest of my EA is very, very slow! Can anybody tell me what I can do against that? What...
Dear all, This is my first message in this forum because I am an amateur MQL4 programmer. I've created my firsrt EA, but I've got a problem. I want to partially close an order, an this creates a new ticket number after the first TP is reached. Could someone please tell me how can I find the new...
Hello folks, I'm wondering about an error in MT4. I test some code and in the journal I see an alert: Order failed to close. Error 0 Why error 0? This should mean no error, but order still open. Any input anybody? Thanks. WorstCases
Hi, I have no experience with metatrader 4 and expert advisors. I wanted to backtest a strategy and found this easy expert advisor builder website. http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/ After I copy, save, and compile the expert advisor with metatrader, when I run it, I get a 130 error...
Hi MQL folks, i'm now trying to learn something about DLL. My question: can i open/close/modify orders directly from a DLL, e.g. by sending a Windows message to MT4, so that it will do open/close/modify work at once? Is it possible or only an illusion? Thanks
hi, like I said do I need help to program my trading set up. I would describe it as a relatively simple program: everytime the Moving Average crosses the chart a buy or sell order will be executed. I trade the EUR/USD and use the line chart for better representation. If there are any questions...
Hello, I am in forex for a couple of months and i decided try to write a simple EA. After reading many EA codes from this forum, i still can't make it trade. I have not codded the strategy, because it is useless sinc it does not want to trade whit this simple code. Please, help me. Where is my...
i have ea that works on demo but on real account it doenst open trades, it says 2011.02.02 05:59:45 Mail: '[Long Trade]' failed. What could it mean? all alerts are disabled but it was asking me for trade confirmation. Please advice
I am trying to edit the script code to my choice but it is not allowing me to do so...!! Says "Access denied". Can anyone tell me what is wrong here?
hy i dont know why the start does not work at all the init is ok .but there are no order or printing line from the start . the EA works good until last hour
Hi there, From time to time, I have to right click on the price chart and select "REFRESH" to update the HistoryCenter and also the chart price. Is there a command or script that can do this every 30 minutes? It is rather concerning to get a message like: HistoryCenter: synchronize, 2075 bars...
I use a simple method for each trade I make... risk of 0.5% of the total account balance per trade however it doesn't seem safe enough.... <refer to the spike in the attached report file> is there a better way to manage volume so that it increments not so rapidly ?? thanks
Hello everybody, I would like to know how to get the closing price of Friday and the opening price on Sunday for an operation that shows the difference between these two prices and shows it on the chart. Suppose the price of the EURUSD has closed Friday at 1.36095 and today(Sunday) the opening price...
I was running an optimization for 4 days and the computer lost power, and the results do not seem to be saved inside mt4 - I checked the logs but dont see any record of it. Does mt4 save optimization results in a log file, as it's optimizing, as it appears inside the terminal window?
I want to track my open orders, and when one gets close to it's stop loss, I want to place an order in the opposite direction, and when either of them get to stop loss or take profit, they both close at the same time. Does anyone already have some code for this that I can have and play with? Thanks...
Is there any way to change where an EA places an order? I am looking to set up EA that places orders at the open of the next bar after something occurs. Any idea what line(s) of code I would need to accomplish this? Thanks!
  HELP!!! (6)
Alright, I've put together a strategy that is supposed to buy at the open of the next bar when the previous bar's Close > Open. The trade ends either at my stop/limit or when the Close < Open (if I haven't hit my stop/target, my trade should end at the open of the down close). I cannot get this code...
In MQL for any indicator say Istochastic() regardless of what parameters input, is the indicator value updated with every incoming tick or is it updated with some time candle?
As I know, until now there is no support to develop mt4 or mt5 progran to run on windows phone 7 platform, any planning in future to develop this support?
I created a very, very simple expert advisor with a very simple strategy. I have run several backtests on few brokers with no error. However, when I run demo or forward test on broker FXOpen (ECN Demo Server), it show some comment which I cannot figure out why. My expert advisor do not have any...
Something I have noticed both on my computer (XP) and on my VPS (Server 2003) is that when I run many MT4 terminals then Windows start behaving badly, not just MT$ but any open windows application. (I run around 20 terminals but have decreased Max bars in history/chart to a minimum in most of the...
Please, Does anyone know if there is any way to get the price at which the broker requotes a trade request, from an EA? I tried the below: 1. Call RefreshRates() after OrderSend() gets requote error message (138) 2. Call MarketInfo(), to get current market price but the price I get is not the...
Hi, I would like to scan the last 24 hourly bars and find the 9 o'clock bar then store its open. Is there a function that return only the hour for each bar something like iTime(NULL,0,i)? How else can I solve the problem of finding the 9 o'clock bar? Many thanks
The question is as above in the subject. Has anybody any idea? What MQL4 expression use for assign the expert to the only one computer? The best way will be use mainboard s/n...
Hi, I would like to know how can I execute a calculus only once per bar. I was trying to compare current time to last bar beginning time, but it did not work and to me it makes no sense. I already read others posts here, but I could not find any solution that worked. Thanks #property copyright...
  ASCTrend system (493   1 2 3 4 5 ... 49 50)
I start this thread for the following reason: - to develop ASCTrend EAs according to the manual trading systems described here https://www.mql5.com/en/forum/173249 and - to delevelop new asctrend system for M5 timeframe. Please find updated templates (3 templates) and all the indicators for this new...
can someone show me what needs to be changed to get the following code working? I'm having 2 pending orders, which need to be modified (with magicnumber 222 and 333). When a green line on the chart is moving, it needs to adjust the openprice, TP and SL on the pending orders. Here is what i have done...
So I just realized that you can take moving averages of indicators in metatrader. I've been getting some decent (manual backtesting) results by taking the EMA of the ADX and combining it with the PSAR, and I'd like to automate this system. However, I need to somehow define this EMA-ADX combo...