MQL4 and MetaTrader 4 - page 150

Hi guys! So I have below code: bool oldOrder() { datetime now= TimeCurrent (); for ( int i= OrdersTotal ()- 1 ; i>= 0 ; i--) { bool select = OrderSelect (i,SELECT_BY_POS,MODE_TRADES);int ticket = OrderTicket(); if (ticket == OrderTicket() && OrderSymbol()== _Symbol
Hello all Please shed some light on this discrepancy with iBands and the bands on the chart. Print (iBands(_Symbol,PERIOD_M5, 20,3,0,Ask, MODE_UPPER,0)); This line should give me the current upper value of the Bollinger Band on the 5min chart (with 3 standard deviations ). The result is printed as
hi there happy people, i want to be able to type in point numbers and not price number in an OBJ_EDIT to use to modify my active trades sl and tp, any help on the lines of code onhow to go about this
I currently coded an EA all in the OnTick function. Similar to this template: void OnTick() { bool longSignal = check MACD cross up; bool shortSignal = check MACD cross down; if (OrdersTotal() > 0) { if (shortSignal) OrderClose(Buy orders); if (longSignal) OrderClose(Sell orders); } if
the function below only calculates the dollar amount of the last open trade. I am looking to calculate the dollar amount of all open trades for the currency the EA is on. I can not find what I am doing wrong. can I get some help? thanks in advance. double LastBuyProfit()   {   for(int...
Hi all, My MT4 in my macbook suddenly cannot launch. Before activating the terminal, a window pop up saying shutting down the app. Anybody knows how to fix this? Thank you in advance. Josh
Hi everyone. I just begun testing my strategies on FOREX and there is a doubt I can not answer. This doubt is due to the difference between the candlesticks data retrieved from the broker and the same data retrieved from the metatrader server. This difference concerns both the data values themselves
[Deleted]
Calculating the Risk Reward, yet need help with the Divider for different Pairs, On the USDJPY if I divide by 1000 the return gives me the correct value, eg 2.6 Yet on the EURUSD the value returned is 10,000 time too large eg 14478.37 instead of 1.45 all help appreciated 😊 double reward_risk() {
Hello guys, I am struggling for many days (actually I left it on the side for one year but now I would like to make it work) to customize Fibo levels : color, width, style as well as RAY_RIGHT property. Unfortunately my code doesn't work even after have read the documentation carefully and retried
  MQL4 EA lot size  (3)
Hello, traders/programmers, Currently I'm developing couple of EAs' After setting conditions to open a trade, For example, lets say I'm using EMA crossover: For the first position I'm using 0.01 lot(s), for the second position I want to use different lot size, How can I set a different lot size for
Hi everybody, I am new here just enjoying MQL.... I am referring to Metatrader4 Release 4.00 (Mac). I noted an incongruence between the Mean value at 200 period as evaluated programmatically using the iMA function and that evaluated by the Moving Average Indicator on the graph. Of course I am
Hi. i create indicator for change pair chart. - MQL4 with button : ChartSetInteger(chartID,CHART_BRING_TO_TOP,0,true); my problem : "CHART_BRING_TO_TOP" runing after get new tick. i need chart change realtime when i press button. Thanks
Hi I want to make an alarm like this My expert has 1 or more positions at the same time. When the indicator gives the exit signal, the positions are closed. I want to give an alarm when the positions close 1- Close 1 position Eurusd +$20 Profit Comment Currency Position type Number of positions
I have been having trouble with my MT4 software from IS6FX company. And I tried to install MT4 software from metatrader4.com as the official program. But what I downloaded as MT4setup.exe was showed the MT5 screen. It's unlikely to happen except something totally wrong happening on metatrader4.com
Toolbars & Status Bar Not Appearing on MT4 Desktop Open? Using a PC and Windows 10, on closing then reopening MT4 from the desktop shortcut the Toolbars & Status Bar are Not Appearing on MT4 Desktop Open?? Any assistance would be much appreciated, thank you
Greetings! I am new to the community, working in mql4, and wanted to share my coding journey so far. I invite you all to join me towards my goal of creating a profitable EA! I hope to learn from everyone and hopefully contribute as well! Attached are two scripts for creating outer (major trend lines
I have been trying to make an EA, I used CopyRates in the OnInit function. And I noticed the values weren't refreshing as new tick data came or the new candle formed. So is it advised to place it in OnInit fuction? Thanks for help
Hello everyone, I'm trying to build trading panel and I'm finding it difficult to move few items at the same time. I'm using on event handler on EA, tried Drag option and also object click, the result remain the same: after moving one item and releasing my button, the other objects follow. Would
Hello, I was able to read from a file outside of MT4 folders using windows API but when I'm trying to write there are spaces in between each letters. It's an old code I found online and tried to fix. I'm guessing it has something to do with the MulDiv function but not sure. Can you please take a...
Hi all, I need some programming help. What I want to do is kind of trivial to do if done graphically, but I haven't figured out how to do it inside an indicator program. 1. Rename objects: I want to rename chart objects such as an OBJ_FIBO so that it has a different "ObjectName". (NOT...
[Deleted]
Hi, What are some of the technics that are being used for drawdown reduction
Dear My one of client purchase a product after that he can't activate his problem, it give the error "global initialization failed" Also he losing the activation when you try to install product in same computer
Hi everyone, I got a very BAD problem. The data on my Metatrader4 app on iPhone is frozen. Absolutely nothing updates. Tried logging out, relogging, removing cache, deleting and reinstalling app, still the same problem. Anyone know the solution? This is really bad, thank you
//+------------------------------------------------------------------+ //| Test01.mq4 | //| Copyright 2021, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2021, MetaQuotes Software Corp."
I tryin to easy show/hide indicators on the chart window, better that switch templates, I think. I did the interface and the buttons for each one, this example is with easy moving averages , but I think can be used for Ichimoku, BBands, etc, please check on the screen shot. I have the buttons done
My trading capabilities are fiables, it says investor mode in the journal. How do I restore my trading capability. Thank you Laurent
Hi all, Hope you are all well. Can anyone recommend any free addon to MT4 to improve charting i.e. drawing tools etc.? I need to go back to MT4 from trading view. Thanks
Hi all. I've been using static variables but now i have problem for declaring static arrays. I want elements of array not to be change when timeframe changes. static double a[ 3 ]; static double b[]; int OnInit () { ArrayResize (b, 3 ); } int OnCalculate () { Comment (a[0]); Comment (b[0]);
[Deleted]
Hi, Putting together parameters for a buy or sell; stuck on, a parameter where the points/pip are counted when the bar is closed, then trades when a expected number of points are counted from the bar. eg, the parameters i've used are: //Buy If(Close[ 1 ]+ 0.0001 ) //Sell If(Close[ 1 ]- 0.0001 )
[Deleted]
Hi, Putting together parameters for a buy or sell; stuck on, a parameter where the points/pip are counted when the bar is closed, then trades when a expected number of points are counted from the bar. eg, the parameters i've used are: //Buy If(Close[1]+0.0001) //Sell If(Close[1]-0.0001) //there is