MQL4 and MetaTrader 4 - page 158

  Help error !  (4)
//+------------------------------------------------------------------+ //| Morphius.mq4 | //| Copyright 2022, MetaQuotes Software Corp. | //| https://www.mql5.com |
hello, is this code right? I'm trying to use percentage on my Profit so when the AccountEquity() >= DailyProfitTarget it will close all of the trades I'm not sure on how to code the DailyProfitTarget tnx for the help void OnTick () double
Hi I'm trying to write my first indicator - at the moment its simply plotting the SMA (red in chart below), and SMA at 60min and 120min SHIFT (purple and blue respectively). When I test it over the last few months I get a number of regions where the SMA lines hold the same value for around a week eg
Hello, I get that error "Please recompile your product with new compiler" even i compile with version 5 build 2395 of 16 Dec 2021. How can i get a newer version of metaeditor
how to create close bouton for an indicator on the chart. on MQL4
hello, how do i close specific order using OrderClose(). i did get the value of the OrderTicket() but i cannot close it. i think i have problem on my code void CloseProfit() { double MAXprofit= 0 ; int TicketOrder= 0 ; for ( int i= OrdersTotal ()- 1 ;
Hi, I´ve bought an EA and installed on one account/MT4. When I try to install on one more account/MT4 on same VPS I get message: "Installation is failed". Where to start find the issue? I know I have activations left. Thanks
hello everybody i want to build an head and shoulders ea but i dont know where to start
Hi, I have already opened 5 trades. When open 6 trade I need to get all infos from last opened trade(6) (datetime,tradetype,..) How to do this? Regards
guys i have this code that calculates the total no of trades online for the current symbol. Somehow it only works when z == 0. If z>0 then the code does not stop and it continues to run. void OnTick () { int total,z,j; total = OrdersTotal (); for (j= 0 ;j<total;j++) { OrderSelect
Plz tell me MT4 code of bullish hammer candle
Hello guys, I am running into a zero divide error because my formula is based on the percentage change from the lowest/highest the last x bars and due to the nature of this it gives me a zero divide error. I am not sure how to solve this, if anybody could provide some insight it would be much
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