MQL4 and MetaTrader 4 - page 44

To post a new topic, please log in or register
Hello I want to extract a decimal value ( for eg: I want to get 0.1234 from 15482.1234). Please advice me how to code it. Thanks and Regds mithetnme
Is there any way to close all buy/sell trades at once? There is a "Multiple Close By" feature in N2Trader which can close all buys/sells alternatively until all trades be closed or just one trade (which there are no pair trade for closing it) remains: At first, i thought N2Trader uses the "Close...
Hi MT4 has been updated automatically by Google Play Since new update Built 1114 (19 apr 2018), alerts messages sent via MetaQuotesID are sometimes late, sometime not received anymore. I cannot even rollback MT4 android
  oldest order's profits (18   1 2)
Is this the right way to get the oldest order's profits from too many opened orders thanks for help//+------------------------------------------------------------------+//|                   oldest order...
Dear how to count only open orders like OP_BUY and OP_SELL only. i like to compare order count and after i want to execute the program. i made the function as below. int totalordercount() { int total=0; for(int i=0;i<=OrdersTotal();i++) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); {...
Hi all together - I do need an Custom Code for opening of the trades. I have created an EA with EABuilder for MT4 First trade 0.01 Next     0.02 Next    0.03 Next    0.05 Next    0.08 Next    0.13 Next    0.21 Next    0.34 Next    0.55 Next    0.89 Maximum is 10 Trades And after closing of all...
I have an EA that may open and close several trades during a Trading session. If the Equity increases by $150, then I want to close any open orders and stop/exit the EA from any further Trading. Thank you.
Hi I've found that there can be gaps in Heiken Ashi calculations when presented in MTF. But not when heiken ashi is called from another indicator. Does this make sense? A Heiken Ashi calculation uses the following formula   double haClose=(Open[pos]+High[pos]+Low[pos]+Close[pos])/4;  double...
Hi all, I am new to trading and MT4 so please forgive the new-ness. I am making it a habit of printing charts and put my comments on them but have been encountering problems printing them. Here's what happens: 1. Print preview is good. 2. It's only when I click "print", which whether printed as soft...
Hi Experts, What do you guys think of the strategy tester report of the EA I coded? Is it worth trying live? Regards, Tim
Hello, Here is my goal : Immediatly hide/show Moving Averages after click on button. But, now, it always waits a tick, as the function is placed in "OnCalculate". How can I do it please ? Here is my code : int OnInit(){    TLR_Moving_Averages_Settings();...
I've been using Bahnschrift font for an EA on Windows 10.  Tested it on other OS, and found that Bahnschrift font is not working properly on Windows 7, and it reverts to Arial.  So I tried the following: #resource "\\Files\\bahn_bold.ttf"string bahn_bold = "::Files\\bahn_bold.ttf";Void...
I'm looking for some good educational resources besides this forum for learning how to code with MQL4. My ultimate goal is to create an EA that uses a currency strength meter and a stochastics oscillator to place trades. I'm making some good progress in making one, however I'm hitting some walls and...
Hello i got an error like this   could anyone please help me to figure out how to fixed it?.. this is my stoploss code : double getOrderStopLoss(int orderMagicNumber, int orderType, double price) {   double value = 0;   if(orderMagicNumber == 700) {      if ((Bars>20)&&(sqLowest(Symbol(), 0, 20 , 2)...
please help me with this code I need to use v keys to right: (AaBb) // First need to check if VK_CAPITAL is ON?           keybd_event(VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY, 0);// Press Shift Key           keybd_event(VK_A, 0, WM_COMMAND, 0);              // Press A Key (To Right A not a)...
Hello, I am looking for EA that will close positions after close candle under/above MA. I found EA that closing positions when price crossing MA but it is not what I need  
I just bought a new laptop with windows 10 on it. Now my mt4 does not appear right. Especially some of my custom indicators. For example I have an indicator called Average Daily Range. It appears in the lower left corner and the text is all jumbled together and cant be read. Does any one have any...
Greetings, Does anyone have any solution to MT4 indicators not working on high resolution screens yet? This thread https://www.mql5.com/en/forum/158168 basically says there is no solution other than the developer fixing the indicator. But does anyone else have any other solution yet? The majority of...
if i have any ea that opens multiple buy positions and sell positions and i would like to close 0.01 lots of any of the buy positions for example then what is the least complicated way of doing that ?  for example , the ea i coded opens 4 different buy positions with different lot sizes at different...
Hi, I am now studying at a University of London.Mainly I am from Bangladesh.I have knowledge of forex trading.Can I do forex trading instead of any part-time job?
Hello again, I need your help (always...) I am trying to draw VLINEs one bar (what ever the time frame is switched) before a date time (in my case, begining of each week). datetime t = iTime(NULL,PERIOD_W1,i);            int Bars_Ahead =1;            if (t>0)       {        ObjectCreate("Line...
I want to open Order in every candle,not every Tick ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- void OnTick()  {   if(Close[1]>Open[1])      // Buy      int  ticket =...
I access MT4 through Capital City but I am not able to upload any custom indicators because my directory for this program does not contain MQL4, Expert, or Indicators folders. I am new to this so I hope I have described the problem using the right language. I need to know why these folders are not...
Is there any place I can download build 950? Thanks ahead!
  class FruitClass (SOLVED) (37   1 2 3 4)
Hello everyone, I am not sure how to ask this question, but I give it ago anyway. The value of the first variable changes every time that FruitClass is called (excuse me if that the incorrect terminology). Now as for the rest of the variables stay the same values until they are given a specified...
  OrderProfit (18   1 2)
Hello, A trade must be closed if its losses reache -25$  The probable codes  are : for (int pos = 0; pos < OrdersTotal(); pos++){       if ((OrderSelect(pos, SELECT_BY_POS) == TRUE) && (OrderMagicNumber() == magicNumber)) {                if (OrderProfit() >= -25) OrderClose(OrderTicket(), lot, Ask,...
I need to make active ... one of the existing chart window ... I notice there is ChartOpen function.... But what does it?  It opens a new chart window with the specified symbol name... Well... I dont need it.. I need simply to go to one of the existing chart windows and make it active... rather...
Hi, I'm trying create a script that loads data from all pairs from certain timeframes. The logic is : Attach script to Window A Script Tells Window B -->    Load Pair X   Load Time Frame Y  ChartNavigate to shift -99999    if Time of First bar after ChartNavigate is still after 26 March 2018 00:00...
Hi, SymbolInfoDouble() or MarketInfo() can give the current market spread Is there a way to know what was the spread for previous 10 or 20 candles ?  Thank you.
Hi guys I have written code in an EA , that generates data during backtest such as equity and different times, drawdown,active trades, exposure and so. It also produces csv files and html report at the end of the backtest. What I would like to do is put that code in an indicator (that I will share...