MQL4 and MetaTrader 4 - page 147

Hello, MQL4 does not seem to have an inbuilt function where a trade made by the user is detected. I am not even sure how I would go around defining it? Has anyone got an idea how to approach this problem? Thank you
[Deleted]
  MQL4 skip a bar  (1)
Is it possible to skip a bar after completing a trade. if ( Bars >LastBar+ 1 ) { LastBar= Bars ; } return;
Hello, so my target is to create Trade Up with trailing stop of all open order either it OP_BUY or OP_SELL after several "Distance" of pips going profit. So here is my code: void TradeUpTrailing() { double LastBuyOrderPrice = 0.0 ; double LastSellOrderPrice = 0.0 ; for ( int i
I want the indicator to give sound alert whenever price riches the lines. //+------------------------------------------------------------------+ //| SweetSpots.mq4 | //| | //|
Hi There, As you know each Oscillator type indicator has different ranging, for example TSI is ranged between -100 to +100, but on the other hand OBV is ranged between bigger values like -20,000 to +20,000 for example now when we show both indicators in one window both ranges will not cover each
whats the difference between a order ticket number and magic number.... when we place a order the number appeared in leftmost corner in orders pool is ticket number?? 
hello, i bought Andrew Young book and start learning how to code in mql. I'm try to figure out why i don't get any more trades. for example : in buy orders the logic is simple if(FastMA > SlowMA && Ask > LongMA && BuyTicket == 0) FastMA =10 SlowMA=20 LongMA=240 the EA open trades only once when the
[Deleted]
Hello all, I was hoping for some help regarding an issue I am having getting a 'for loop' to function correctly while using the Strategy Tester (it works exactly as intended live). for ( int i = 0 ; i < BarsBack; i++) { Sum += (High[i] - Low[i]); } Simply put, I want to sum up the difference
Hi guys, Am trying to understand why I get ZeroDivideError for the indicator at the end of the calculation loop. Last 20 candles SlowMa is 0.... This is code of the indicator: int init() { SetIndexBuffer(0, CurtaBuffer, INDICATOR_DATA); SetIndexBuffer(1, MediaBuffer, INDICATOR_DATA);
  plz help me  (2)
plz tell me mt4 code of below condition current candle volume > previous candle volume
can any one help why this code does not work for trailing stop for buy position?in compiler has no error but while back test the EA tester stop working. i want when the price increase 50point from open price then stoploss move 50point upward. double StopLossBuy = Bid- 100 * Point double buy=
Hi, I've got a real strange problem using a dll with MetaTrader: I've written a 2 Indicators and 1 dll. Both indicators call the dll to caclulate its values. Indicator 1 calls function1 from the dll to get its values and Indicator 2 calls function2 from the dll to get its values. Indicator 2 can...
[Deleted]
I am basing my indicator of the Ichimoku indicator and I need the values of Senkou Span A and Senkou Span B. The problem is that the indicator works for all the bars on the chart, but I the Senkou Span A and B are ahead or shift 26 periods forward and I can get my indicator to draw past the Bars on...
in my expert i want the distance between (open price-EMA)*2 for take profit?how can i do this in mql4
hello, I just wondering if there is a way that i can close the highest open position using OrderProfit() function because my strategy is once i maxed out the max trade out of my ea. the ea will close the highest profit order and open new order and it will repeat the process
[Deleted]
Hey all the readers! My programming skills are not that much good so i needed help.My problem is that i have placed two orders one is pending order and one is market order . i want that when market order reaches at its take profit value or price level reaches to take profit level of market order...
Hi all. Following code works correctly, except last line for minimizing dialog: CAppDialog AppWindow; int OnInit () { // Codes for dialog creation AppWindow.Run(); AppWindow.Minimized( true ); // not working as expected. return ( INIT_SUCCEEDED ); } Trying to use Minimize() method, it
  Problem with ZigZag indicator  (36   1 2 3 4)
Hello, I'm trying to develop an expert that digs the historical data (peak and bottoms) to be used for my main expert. I decided to use zigzag indicator since it's simple and finds the high/low easily. My problem is, when I call the ZigZag.ex4 using iCustom() function I cannot get the correct high
Hello, I am coding an EA which is supposed to open trades only if my indicator draw an arrow but sometimes it opens order without any arrow. Do you have an idea of this kind of issue? Thank you
Hello, I need to use the number of testing days within an ea (basically test end date - test start date) How can I get it ? Thank you
I was hoping someone might help me In the case whereby the (iHigh) and (iLow) in MQL4 finds the highest or the lowest price of a single candle, Is there a way or function i can use to find a common low or high price shared by a set number of previous candles and use the returned values to draw a
int OnInit () { //--- indicator buffers mapping SetIndexBuffer ( 0 ,SlopeBuffer); SetIndexBuffer ( 1 ,SMABuffer); //--- return ( INIT_SUCCEEDED ); } //+------------------------------------------------------------------+ //| Custom indicator iteration function |
  MT4 Profit Bug  (1)
HI guys, im testing an EA on my broker MT4, but i found out the result is abit strange, because the result is showing profit but when i look at the total amount of profit at below, it only shows a few dollars. Im not sure why, my broker is FBS Zero account with 1,000 USD and 1:500 Leverage, Its not
hi sir have an EA that creates horizontal lines and create a button when initiated. If the button is pressed an order will open and all the horizontal line that have created upon inititating the EA will be deleted buy ObjectDelete. For example i pressed the button on 1 min TF it do its job making an
Pleasant Day to everyone. I've been working on an indicator that shows when the current trend is at a Higher-High, Lower High, Lower-Low or Higher Low position. Indicated as HH or LH Text Above the Candles in Green and LL or HL Text Below the Candles in RED. The problem I'm having is that the text
The CCIMA EA uses Commodity Channel Index and Moving Average to enter the trade. The CCIMA EA can use to trade all kind of Forex, Indices, Commodity, Metal and Crypto Currencies inside the MT4 platform. Overview Trade direction based on MA trend up and down and CCI breakout from base level -100 and
  Uninit reason  (1)
Hi guys، I ruined my expert on my pc it works well, but I run it on VPS server it don't work, it gave me errors like uninnit reason 3,5. What I should to do
Can anyone help to resolve this is there a place where you can check the fault codes
[Deleted]
Is there another way to derive the body of the candle, rather then using moving average. double AvgBody( int ind) { double candle_body= 0 ; ///--- calculate the averaged size of the candle's body for ( int i=ind; i<ind+m_ma_period; i++) { candle_body+= MathAbs (Open[i]-Close[i]); }
Calling the system gui library and creating a simple dialog program initializes fine on mt4, but once the chart cycle is switched several times, it will be wrong, while on mt5 there is no such problem, everything is fine The code and images are in the attachment