MQL4 and MetaTrader 4 - page 226

How i do so that after an Array, the indicator will sleep for some time, in this case (2 candles) My attempt, but dont work if (CONDITIONS) { Buffer1[i] = Close[i] - iATR ( NULL , PERIOD_CURRENT , 14 ,i); if (i == 0 && Time[ 0 ] != time_alert) {meuAlerta( "Buy" ); time_alert = Time[ 0 ];} Sleep ( 2
Hello dears! I want to find/get max and min price from a certain loop. Example: there are 3 orders are running in EURUSD. now I want to get max price and min price among the running orders. double max_running_price = 0 ; double min_running_price = 0 ; if ( OrdersTotal () > 0 ) {
Hello In some EA s my mt4 stoped and closed when I start to optimization of EA . I hadent this problem till I changed laptop windows8 to window10 . What is the problem
Looking through the code documentation for creating EAs on https://docs.mql4.com/, I can't seem to find a way to programmatically call trailing stop through the chart. Is there a method such as EX: 'ChartSetTrailingStop()'
Hello ! I'm looking for a script where you can choose X lot of the position size to close out. For example: If I have a 0.10 lot size open and I want to close 0.04 of the position the script would close that part and the remaining position would only be 0.06 lots. I kind of found similar scripts to
hello everyone. Can anyone help me in getting the High\Low values of Heikin Ashi, I know that these can be Mapped by using iCustom() function. I do not want to get into the details about what will do what. I just want a simple line of code which will give me these values. if you can help then
So I have an EA that runs at 7am every day and gets the highest and lowest open/close times in the last 12 hours. However, it's not working properly and instead runs the code for the last 36+ hours (I can't identify exactly how many hours but it definitely isn't 12!) Any ideas? Here's my code
[Deleted]
This has genuinely got to be one of the must ludicrous, most ridiculous situations I have even been in with this coding language. Is there any reason as to why my trades are closing, regardless as to the button pressed on the prompted Messagebox - despite the fact my EA is only supposed to close
The glitch tends to be more pronounced when there are open orders, but happens less frequently if the charts volume and stop levels are set to none. The the images, the chart has all of the item colors in chart properties set to none besides the charts background color and the ask line, but glitch
I am trying to renew my VPS subscription as follows: 1. Open MT4. 2. Right click on my real account on navigation panel. 3. Click on register virtual server. 4. Choose amount (One yr subsc.) 5. Select card payment (Visa) 6. Enter card details 7. Enter OTP password 8. Click next At this stage it
[Deleted]
Hi I want the position to close when the position reaches 10 pips What am I doing wrong? //--------------------------------------------------------------------- void Trail2() { { if ( OrderSelect ( 0 ,SELECT_BY_POS,MODE_TRADES)) if (OrderMagicNumber()==Magic7) { if ((Bid-OrderOpenPrice())> MathPow
Hi All, I am looking for some code (or Function) that will Calculate, in my Expert Advisor (MQL4), regardless of which currency I am looking at, the Current Profit on on All open trades. For example: Curr1 = 500 Curr2 = 250 Curr3 = -250 Comment ( Net_Profit on Open Trades = $500 ); Many Thanks
I'm running MT4 (Mac desktop version) at Forex.com. I have nothing in the Signal, Market, or News tabs. What am I doing wrong? https://www.screencast.com/t/wDspEEzYQMlW TIA! Chop
Hi everyone, I need some help please to finish this EA. I am struggling to basically modify a pending order (SL and TP) only once at the next open bar. //+------------------------------------------------------------------+ //| Simple strategy.mq4 | //|
Hi there, really could use some help here. My code is pretty simple, I drag the EA onto a chart template and it get's the values from a Fibonacci indicator on the template. The problem is when I call the ChartSetSymbolPeriod method when iterating between periods or symbols I either get object data
Hi, I am trying to print Buy and Sell arrow depending on the nature of crossover but this code is printing both the arrows on chart after crossover while depending on the condition it should print one of them. if (shift== true ) { if ( OPEN > CLOSE ) { BufferBuy[pos] =
Dear all, Is there any EA for testing the quality of automatic (EA) execution of deals on broker's account? Are there any standard methodology with set of metrics (like execution time, slippage, number of failed orders, etc), benchmarks that would let to do an adequate comparison over a range of...
Somebody was asking for Fibonacci Indicators in MT4 section. These are the indicators I wrote for MT3 for my own use. These are very simple and easy to convert for MT4, if somebody needs them on MT4 platform. Thet will work on only 1 hour or less than 1 hour timeframe chart.
Hi everybody, I am using scaling in a strategy entering one trade per candle if other conditions are met using: *** The issue I am facing is that I want all SL and TP of all positions on the chart from the same EA to be modifying together as the SL & TP are following a certain indicator on the
hi guys i want to code an EA that when open a Buy/Sell position with 60 point profit. if the position goes to -20 point profit then open a position In the opposite direction of first position with 60 point profit the code is hear: if (orderType==OP_BUY) ticket = OrderSend ( Symbol
  If else error  (4)
Hi I built a test code but suprisingly it wont work the code is : void OnStart () { double test = 0; if ( double == 1) { Alert "yes" ; } else{ Alert "no" ; } } I keep getting this error '==' - unexpected token cl.mq4 17 17 'yes' - open parenthesis expected
Hey everyone, I wanted to create a function for risk management as seen in the code below. double OptimalLotSize( double maxRiskPercentage, double ATR_Lot_Multiplier) { double accEquity = AccountEquity(); double lotSize = MarketInfo( _Symbol ,MODE_LOTSIZE); double tickValue = MarketInfo(
Is it possible to copy a trade from one VPS to another, both mine and both using the MT4 VPS Cheers, Simon
Hello this is my first post. I've been passively reading these forums for 3 month now.... :) But this problem I just can't fix alone and it drives me insane ... ^^ My Expert Advisor should set Trailingstops according to calculated Fibonachi levels. However it seems that the trailing stop is only...
void modifyAllBuyOrdTP(){ if(CountTradesBuy()>=2){ for(int l_pos_4 = OrdersTotal() - 1; l_pos_4 >= 0; l_pos_4--) { OrderSelect(l_pos_4, SELECT_BY_TICKET); if(OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue; if(OrderTakeProfit() == findTpL_BuyOrd()) continue;
Hello. Here is my code. it passed the compile but freeze in MT4. Could anyone please help. Sorry for my bad English. I'm not a native speaker. Thank you very much. if (((OrderType()==OP_BUY) && (signal == "sell" )) || ((OrderType() == OP_SELL) && (signal == "buy" ))) {
if (OrderType()==OP_BUYLIMIT ||OrderType()==OP_SELLLIMIT || OrderType()==OP_BUYSTOP||OrderType()==OP_SELLSTOP) { if (!OrderDelete(OrderTicket(),Blue)) ErrorDescription( GetLastError ()); } The code above executes orderdelete when there is a pending order type, although what i'm only trying
Hi I have a Consecutive win count function which is capped at 10. I have just realised that it doesn't stop counting at zero - so i get minus numbers. If there is a win i want to increment by one upto 10, and decrement by 1 down to zero. This is the original code below - i have tried adding breaks /
[Deleted]
Hello, In MT4 strategy tester , what is current spread? Is it referring to spread as of now (the time I am do the testing) or the spread info in the tick data (if there is)
bool once= 0 ; double z[]; void OnTick () { //--- if (!once) { int j = 0 ; for ( int i= 0 ; i< 100 && j< 5 ; i++) { double y = iCustom ( Symbol (), PERIOD_CURRENT , "ZigZag" , 12 , 5 , 3 , 0 , i); if