MQL4 and MetaTrader 4 - page 1232

To post a new topic, please log in or register
Hi I have the alert code below, I am expecting it to fire 5 times and then stop, I tried different version and played around with different blocks of code, but it is sounding once with the block 1 and twice with the block 2 as indicated in the code below. that is if I un_commnets the block 1, it...
I am trying to find the number of pips in loss so I made this line if (OrderType()==OP_BUY) { PipsOpenPL=PipsOpenPL+MathRound((OrderClosePrice()-OrderOpenPrice())/MarketInfo(Symbol(),MODE_POINT)); } if...
Can an Expert Advisor "execute/launch" an external script, located in scripts folder?
Where can I find the  PDF version of Documention and Book?
Is there any way to detach a graph so that it can be dragged to another monitor? Any chance this being a feature in the future if not.
I need to lunch a terminal automatically with the API CreateProcess and afterwards close it with the API TerminateProcess. Please could someboyd show me how to declare them and later on call them in MQL. The VB statement of CreateProcess is: Declare Function CreateProcess Lib "kernel32" Alias...
Does anyone know how to use alert feature to have an alert sound at the close of each 4 hour bar?
seems like that indicators do not model bars of a different time frame than period(). what I notice is that the EA is indeed modelling the bar[0]. exactly asthis article, Tester in the Terminal MetaTrader 4: It Should Be Known, describes it. however the same is not occurring forthe indicator. I...
Hello, can someone please explan me in little words the need from the optimize funktion from the tester oder give me a link to a great artikel, i like to understand this future option, but at the moment I have vervy fear from long texts.
Someone can explain why some indicators use the “ for(int i=0; i<limit; i++)” direction of calculation and others use “for(i=limit-1; i>=0; i--)” direction?
Hello all, I'm coding a hedging strategy where I enter a trade on a symbol and place an opposite direction trade on the hedge symbol. When the sum of the profits of the two orders are >= a set profit amount in dollars, I want to close both orders. My problem is that the expert seems to close...
Hi, I wrote the attached EA, and I'd like to operate with 1 hour time frame. I'd like to receive signals only when the new bar is complete, and not in a smaller time frame, when the new bars is setting up. How can I modify this EA? Thank you! Alberto
the result is that huge amount of trades occur and each of them was opened and closed within 1 min. What might caused the problem? I am driven crazy....
  2 MAs (1)
Does anyone have a 2 moving averages EA code, I repeat 2 moving averages, not one?
Hey everyone! I really don't know anything about this specific programming language yet and all I want to do is get alerted by email when the 30minute parabolic sar changes. Can someone help me out? Thanks alot! -Arie
Hello! I have this code,but it's not work. val=iHighest(NULL,0,MODE_HIGH,Bars-point,point) (the point is a Bars number point<Bars) I would see the maximum in a range (point to current bar); I know iHighest give me only the bar number of highest bar.But this code not work for me. Thanks for help.
i made a daily pivot with offset that works with 1 hour and under. but when i switch to the 4 hr chart, it becomes inaccurate because if i off set the time zone by 2 hours, the pivot calculator is trying to reference the high low close of the 4 hr chart instead of the 1 HR chart. does anyone know...
Back-testing issue. Heres a little problem that i have been experiencing for a long time but haven't bothered to find a solution until now. My system is based on an hourly chart. Now lets say my system opens a trade at 19:00 (time). and the TP (or SL) is hit at 21:00. There is no problems here...
Error 2 ERR_COMMON_ERROR encountered using MT4 Build 211 (15 Oct 2007) AccountServer()=MIG-Demo Copy of Journal: 2008.03.12 19:25:05 '644565': modification of pending order #12410751 sell stop 573916.96 »k at 0 sl: tp: 0 -> price: 2 sl: 2 tp: 2 failed [Common error] 2008.03.12 19:25:03 '644565'...
or does it use the time of tick modeled during the back-test?
HELLO, I AM NOT A PROGRAMER... I WANT TO DO THE FOLLOWING: I NEED A CODE THAT EXECUTES ORDER AT A SPECIFIC LEVEL BULL PRICE AND BEAR PRICE WHICHEVER IS REACHED FIRST. I KNOW I CAN DO THAT ON THE PLATFORM, BUT BESIDES THAT I NEED THE CODE TO ONLY EXECUTE ONE ORDER; WHAT I MEAN IS THAT IF THE...
Hi seniors, I am coding a script that will place buy/sell orders according to my risk rules. I need to develop the following: If the pair is USDXXX, then use this formula... for calculation If the pair is XXXUSD, then use this formula... for calculation I have written 2 separate scripts for buy...
Hi can some one tell me how to modify the days date to an existing order
I’m MQL4 newbie, but also professional .NET programmer (C# in fact). I’ve written my first EA with many errors(nothing uncommon ;) and found following things: 1. lack of debugger – nowadays programming tools cannot exist without professional debugger with ability ofsetting breakpoints (the best...
EA's some are (blue and gold) mine shows up gray any significance? Should I be worried? Does it mean anything? Thanks
Hi,professors ! I want to get your help: how to compile the custom indicators of PR. The main body of PR is just below: Pr1=(iMA(NULL,PERIOD_H1,10,0,MODE_SMA,PRICE_CLOSE,0)-iMA(NULL,PERIOD_H1,20,0,MODE_SMA,PRICE_CLOSE,0)); Pr2=(iMA(NULL,PERIOD_H1,10,0,MODE_SMA,PRICE_CLOSE,1)+iMA(NULL,PERIOD_H1,10...
Hello guys, I'm trying to include the body_height/candle_height ratio to my entry conditions and MT is complaining about "zero-divide". This is how i try ty calculate it: double low = iLow(NULL, 0, 1); double high = iHigh(NULL, 0, 1); double close = iClose(NULL, 0, 1); double open =...
Hi! I started MetaTrader this morning and found that nothing was changing. I moved the market watch to the tick chart and the tick chart says "Waiting for Update". I obviously have an internet connection as I am able to come here. I also opened another trading station that I have and it is...
Hi, I'm having problems running Trader Advisors with Strategy Tester. See below very simple OrderSend Advisor (from the OrderSend documentation), which is giving me error #129 everytime. Any idea what might be wrong? Thanks. //+------------------------------------------------------------------+//|...