mql4

  1. shanmugapradeep

    [MQL4 CODING] Function to close Losing trade when it reached X distance

    Hello, I am making a code, If Buy Order reach above 30 Point from Entry price, close Sell Order If Sell Order reach below 30 Point from Entry Price, Close Buy Order. int gRangeClosing_Automatic = 30; if((LastOrderPrice(OP_SELL, gSellMagic) - Ask) / Point > gRangeClosing_Automatic) {...
  2. TomDominic

    MQL4 warnings: Expression has no effect

    helloo,,, i still have some warnings in my code . expression has no effect . 3 of them . What about it and how can i solve it please ?
  3. ultimate3101

    Hi! I have an Error: 138

    I Made an EA, but get an Error which sais Order Send Error 138 Can someone Help me? input double UpZone = 1.3000; // Define your UpZone value input double DownZone = 1.2900; // Define your DownZone value input int ATR_Period = 14; // ATR period input double MinATRLevel = 0.001; // Minimum ATR...
  4. TomDominic

    return value of orderclose should be checked

    how can i solve this warning..... return value of orderclose should be checked,
  5. Jajaofopobo

    MTF FRACTAL MT4 TO MT5 CONVERSION

    I attempted to convert an MT4 multi-timeframe fractal indicator to MT5 but encountered difficulties due to the differences in syntax, particularly with the absence of barshift in MQL5. I'm not acoder, I would greatly appreciate any assistance in implementing the iFractals coding (copy buffer...
  6. shanmugapradeep

    [MQL4 CODING] Target Revenue in Percentage using Account Balance and Equity

    Hello, I am adding new feature in my EA, which close trade automatically when it fulfilled defined earning set by user and than it redefine with value again with new Account balance. Example : Account Balance = $1000 Target Percentage = 10% (10% of 1000$ = $100) When Account...
  7. shanmugapradeep

    What does OrderType() > OP_SELL mean?

    Hello, What does OrderType() > OP_SELL mean? There are a few instances in the EA I am working with that have some if conditions with OrderType() > OP_SELL . I understand that OrderType() == OP_SELL means it should be equal to a sell order, and OrderType() != OP_SELL means it should not be...
  8. shanmugapradeep

    Understanding Trailing Stop Loss

    Hello, I am finding little difficult in understanding Trailing Stop loss. How does it work, does it take value from Stop Limit, Trade Entry Price or Current Price or Highest Peak in Favorable direction. After reading some blogs about Trailing Stop, This what i understand :- Condition: If...
  9. dzungsua

    [MQL4 Coding Help] Trouble with Time Filter

    Hello Enivid or any coder here ; I have a simple EA that has been working very good for me ; the only problem I have with it is the Time Filter ;the Hour funtion is OK but the Minute function is not ;if I set it to trade from 7:15 to 11:20 it still start to trade from 7 :00 and stop trading...
  10. shanmugapradeep

    [MQL4 Coding Help] Fixing News Filter EA

    Hello, Currently i am coding a news filter EA and having some errors. #import "urlmon.dll" int URLDownloadToFileW(int pCaller,string szURL,string szFileName,int dwReserved,int Callback); #import #define INAME "FFCPing"+_Symbol #define TITLE 0 #define COUNTRY 1 #define DATE 2 #define TIME...
  11. shanmugapradeep

    [MQL4 Coding Help] How to write If-else sequence in MQL4

    Hello, What is correct way to add if else statement. TYPE 1 : If else sequence separately : if (condition1) { //Condition 1 task } else { if (condition2) { //condition2 task } else { if(condition3) { //condition3 task } else { //condition else task } TYPE 2 : Else if statement sequence...
  12. TomDominic

    warnings

    how can i remove this warnings,,,,, return value of orderclose should be checked, also for orderdelete and orderselect. Also,,,,this Expression has no effect....i have three of this....please help me here
  13. Enivid

    Close All Orders (Positions)

    Please use this thread to discuss our Close All Orders (Positions) MetaTrader script. It's a simple script to mass-close orders in MT4 or positions in MT5. You can download the script from its description page (linked earlier) and ask any questions about this free script here.
  14. TomDominic

    Code questions

    i need a code to compare the bid price and the openning price....plzzz and how can i get to se the bid and open price on the screen,
  15. TomDominic

    About current price ...

    Helloo guys ,,,can someone help me here,,, Iam trying to monitor the current price movement of a candlestick but iam little pit confused .how can i show that movement .Help plzzz
  16. ridwan_007

    Help me to modify my code

    hello all ,, can u help me to modify my code ?... i wanna build strategy like this https://telegra.ph/file/fbdc32ed144011a1c8c0a.jpg with Fxgen and the model is like this https://telegra.ph/file/10ac5ab589d8a46a05554.jpg as u can see the model is not simple ... if the order reach Buyorder5...
  17. J

    Need Help with mql4 Lot size calculation function please

    Hello, I'm using this function in my EA to calculate the lot size position according to account balance percentage but the problem is that the calculation is not accurate specially in JPY pairs, For example if the loss must be 50 usd according to account balance percentage risk most of the...
  18. Johan1974NL

    Order Send 130 Error - What is Entry Value?

    Hello, I keep getting the error 130 and found this article about it. https://www.earnforex.com/guides/ordersend-error-130/ I would like to implement this code but is not clear to me what the entry value contains. if (Entry - Bid < StopLevel * _Point) Entry = Bid + StopLevel * _Point; if...
  19. B

    error 130 elimination

    I get sporadic 130s when using an MA as my stop loss value, so I want to write something that will check for all OrderModify() calls when I have a change in my take profit (or stop loss) values, like: retval = OrderModify( OrderTicket(), OrderOpenPrice(), Valid_SL(MyCalcSL,OrderType())...
  20. MRT

    Open candel EA + TS

    Hello Forum! I'm trying to code a very simple EA which opens a trade when the new / next candle occurs + TS . Part of the code is working as I want and new trades are opening fine but TS simply doesn't work. I was wondering if somebody would be so kind and help me fixing this code ...