MQL4 and MetaTrader 4 - page 520

To post a new topic, please log in or register
Hi I am an experienced developer but this is my first attempt at an MQL4 expert advisor. I am looking open two pending orders on the Germany 30 indicies as soon as it opens (7:00 BST). As my broker is alpari and from what I have read their servers work on GMT+3 this means I should try and get the...
I want to place a pending long order and then when "something" happens : a. delete it OR b. if it is executed, close it. Will it change type if in the meanwhile the price hits the buy limit or will another order be created and this one will be automatically closed? If another order is created, how...
Ok - so first off, if anyone is offended by my "incessant questions", then just do not bother writing on here wasting your own time. For the sake of avoiding waffle, this is what I am wanting to understand if it is plausible to do: Imagine a given system has an average strike rate of 75%, profit...
Hi, ok i tried to get the three last close values in the journal: This is my code at start: double Hilfsvariable= (Close[1]); Print("Aktueller Close ",+ Hilfsvariable); double Hilfsvariable2= (Close[2]); Print("Vorgänger Kurs ",+ Hilfsvariable2); double Hilfsvariable3=...
Hello people. I would like to know if there is a way of find the max and min value inside an array who has a variable lenght. I know how to find the max and min in an array with a fixed number of elements, but if the number of them is variable I don't know what function is suitable to use in those...
I think somewhere in "The Book" if says having user defined functions is slightly less efficient (but much clearer to read and program). I'm wondering if I can use user defined functions while writing the EA, and then, when it's time to compile, copy and paste each function in place of the function...
Hello, I subscribed to a signal, then the signal tried to do an order on XAUUSD and the journal said symbol not found (Even though my broker has it, I do not know why it said not found) and then it unsubscribed. Is there a way to make it stay subscribed when the symbol is not found? Also does...
HerrHimmler
iHigh(Symbol(),PERIOD_W1,1); // returns zero in backtesting Why does the above function return zero in backtesting but the correct value in real time testing? Is it a platform limitation? Or is it something specific to my local installation? I would assume the latter as I seem to recall using this...
  how I code? (4)
int orders= OrdersHistoryTotal();if( OrderSelect(orders,SELECT_BY_POS,MODE_HISTORY==true))    {     if(OrderType()==OP_BUY) //Month()==12 Year==2013  )        {      OrderSend(Symbol(),OP_SELL,,Bid,1,,,"",MAGICMA,0,Red);           return;        }  else if(OrderType()==OP_SELL)...
Hi all, Just going through the MQL4 book. It says that limit orders become market orders when the price is hit. So does this mean there are no actual limit orders in MT4? Thanks in advance.
Anyone know if is it possible to get the actual price where two lines intersect as this usually happens in between bars ?
I might have found an ugly bug in the Optimization side of MT4 build 509, related to the new Spread control feature. After running an optimization for the first time, with a Spread value of say 40 pips specified in the new Spread control box, if you just change its value to another number (50 pips...
If the candle doesnt have upper or lower shadow does the High[] and Low[] return the highest/lowest point of that candle so an Open[]/Close[] value depending on the type of candle (bear/bull) or is it return an empty value?
Hey guys, this is my first post and just wanted to say thanks real quick to everyone here who has contributed. This site is a goldmine as long as you're willing to take the time, be patient, and use the search function. So anyway, after a long struggle but eventual success, I created a script. The...
When drew trend line by --> ObjectCreate("Trendline",OBJ_TREND,0,Time1,Price1,Time2,Price2) . What function use to get degree ? thank you
How to set the color of a moving average in an EA,since i cant find any parameter to set it double iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift) Any suggestions? TY
I have M1 for USD EUR loaded in a single MT4 offline test installation : My Code code at Start = double Hilfsvariable2= (Close[0]); Print("Aktueller Close ",+ Hilfsvariable2); I expected the get one close for each 1 minute candle in the mt4 journal: These are the lines in the history center:...
[Terminal Panel] at the bottom of MT4, which can appear by "Cntl + T." TODO_01 : assign the different value set for different currency pair in the row of the terminal TODO_02: change the font size bigger perhaps the height of row of the table, too, accordingly. Which file in the source code...
Hello! good afternoon. i want to modify attached source to suit what i want style. this is trend line alert and if price line cross then alert fire but it every bar alert fire so i want to try to make it only one times for alert but no luck. i was used static datetime Time0; if(Time0 ==...
Hi HoW easy is it to program a Good For The Day where; the EA will look at order history just for the day and see if it has gotten like 10 pips? thx
I'm using an indicator called 10.2 TMA slope, and although it compiles without errors, and even works in an EA, when I backtest my EA, a whole bunch of error messages pop up in the journal saying, \ 10_2 TMA slope v1_4B 4_30 for EA EURUSD,H4: unknown subwindow number -1 for ObjectCreate function....
I want to substract the minute value as 10: eg: if i give 00 means it should consider 50, 50 means 40,etc... tried following code. but it seems wrong. can you suggest exact idea to substract the minute? extern int newsDateMinute = 30;newsDateMinute -= 10;
Dear All, I tried to write a 2 ma crossover ea. It seems I don't get into making trades for some reason - can anyone help by looking at my code which is very short and explain what the problem could be please?...
Hello! I opened a sell order a wee more than one minute before the market closes. It shows 21:58 in my case. My order was closed a few seconds after at 21:59 with 2.85 loss as you can see. The balance was 9.89 dollars. So my question is that what "so: 91.1%/6.8/7.5 means in the comment tab and?...
Hi Everyone, I have a custom indicator, attached and I write a script to export data of this indicator. This script works with other custom indicator and for some reasons, it doesn't work this time. I very appreciate your help if you could look to see what is the problem with my code. Thank you and...
Hello, I am working to make an indicator which draws two lines making a range from a 22:00 to 06:00 everyday & continue till value changes next day at 06:00. I have used the iHigh & iHighest functions but I still need to give the Shift Count of the bar with highest high & lowest low in...
Does this differ amongst different signals because the is the second signal that has done that. I thought it just copies trades as they happen on the provider's terminal?
I want a native version MT4 for MAC OS, not virtualized !!!!!