MQL4 and MetaTrader 4 - page 449

In mq4 iTime("USDCHF",PERIOD_H1,0) and  how get time for "USDCHF",Period H1, and Bar 0 in Mq5? Thanks
Hi All, I am trying to install MT4 on a new Mac PC and I am encountering problems and please bear with me if this issue has been discussed previously. I have installed PlayonMac and the Wine as advised on the Mac OS instructions. On the PlayonMac Menu under File/Install I am able to search and then...
  SL & TP  (3)
Hi, one question, is it possible to delete a TP or SL once added by script? I have also a custom function of OrderModify...but with parameters 0,0 it doesn't seem to work
//+------------------------------------------------------------------+ //|                                                           HM.mq4 | //|                        Copyright 2017, MetaQuotes Software Corp. | //|                                             https://www.mql5.com |...
Hello friends :-) I  need some help regarding comments in mql4.  below is my code If (condition1) { Comment(abc) } If (condition2) { Comment(xyz) } The exact problem is if both condition is true at same time , i get only only 1 comment in upper left corner.. I need both comments in 2 lines Please...
Since latest mt4 update, when I compile my EA I am getting the 'i' - undeclared identifier error but cannot see which part of this code is causing it: void CloseOrderSell(){    if ((Ask-Bid) <= MaxSpread*PipValue*Point){    int orderstotal = OrdersTotal();    int orders = 0;    int...
  write to file  (2)
I am trying to get a simple script to write the values of the technical indicators to a text file but I do not get the right values.  The output file dates are integers void OnStart(){   int file_handle=FileOpen("h1.csv",FILE_READ|FILE_WRITE|FILE_CSV);      double   macd_buff[]; // array of...
I'd like to return my custom Candle class (inheriting from CObject) from a function. The compiler will complain: "object of 'Candle' cannot be returned, copy constructor 'Candle::Candle(const Candle &)' not found. How can I implement this copy constructor if my class has the following constructor:...
On my VPS I have around 120 ms but when I click on the objecg in the bottom right corner to see my ping, there is usually an option for 100 ms. I click on it and it changes, but then I check later and it has automatically switched back to the default. This vps the ping is no problem, but I have...
I have a couple different EA's that I designed.  But the programmer I used just closed his business and doesn't take coding jobs anymore. I would like to make a simple modification to all of the ea's.  Basically, I want to add the function that if the current Heiken Ashi candle on the chart is...
Hi, I make this simple code to display arrow on chart : canvas.CreateBitmap(0,0, "arrow01", Time[0], High[0], 50, 50, COLOR_FORMAT_ARGB_RAW); canvas.LoadFromFile("ObjBuy.bmp"); canvas.Update(); The arrow01 object display correctly. For having two arrows on my chart, I use this code : canvas...
class Child {   Parent *parent;      public:   void setParent(Parent *p) { parent = p; };      };class Parent{   Child *child;      public:      Parent()      {         child = new Child();         child.setParent(this); // << Can we do something like this?      }      ~Parent();};   I need to...
  #property  (3)
Hi I want put my ea to mql market .but , i have this error  (EX4 file must be compiled using #property strict directive) I've added this code at the beginning of EA #property version     "1" #property description "my description" #property description my description" #property description "my...
Hi , I recently started trading in forex , i had worked with mt5 , and today i started working with mt4 , and I noticed a “charges” fee in my deals that made all my deals negative in profit , can you help me to understand what is this part for ?
Hello everyone, I made an indicator that counts the number of pips and the profit from entry. I found code to make a toggle button, and I incorporated that into the indicator to toggle the alert On/Off. When I place the indicator on a chart, the alert is off, and that is actually the case, so that...
I'm not a coder but I hope I'm giving enough info here for one of you MT4 geniuses to answer! I have a custom EA which was designed according to a set of trading rules and formulas.   When I run it through strategy tester, the trailing stop seems to work properly.   But in my demo account it's not...
[Deleted]
I've read a few of the articles about Genetic Algorithms in optimization, and I've read that GA's may have been built into MT4. Does anyonehave any information on this? Does MT4 (build 209) use Genetic algorithms in optimization? Thanks Nick
Hey, I have written the following code that describes a pin bar and a subsequent bar that closes above the pin bar to confirm it, I would like to control the EA taking these trades by having a horinzontal line on the chart named "trigger" that I can manually move to support and resistance levels. I...
I have an EA that opens BUY and SELL orders with a stoploss and takeprofit based on certain conditions. However, when the moving average turns positive or negative over a certain number of bars, I want to close the order. When I do this, I keep getting error code 138 on the OrderClose. Does anyone...
Hi there, I'd like to create an indicator that runs on a different timeframe to the chart on which it is applied. This is so I can compare certain results from a slower timeframe against those of the primary chart's timeframe. The indicator I have in mind (an indicator version of an EA I have...
Hi one question... every time i try to fill an array with variables it returns this mistake  "constant expression required" this is the code: string tab_ordini[8] = { ord_a, ord_a_reverse, ord_b, ord_b_reverse, ord_a_s, ord_a_s_reverse, ord_b_s, ord_b_s_reverse }; and i have declared them in this...
How do i switch the draw_arrow in AMA Indicator below into draw_line? I replaced arrow with line, and it didnt resolve the problem, it just draw lines downwards. Please, help. Ed
Hello everyone, This is my first EA and also first post on thisforum :-) So, my EA based on Moving Averages Indicator these are basic conditions: 1.       The first candle after crossing thelines is the candle, where I’m placing the pending order with price 0,00015pipsabove ‘high price’ or 0...
[Deleted]
Hi, on an event I want to load a specific profile within a EA. The profile contains several charts.  Up to now I couldn't find any information how to do it. I don't want to klick by myself. The code has to do it. I've found something with "PostMessageA ..." But I don't know how to implement this....
  mqh file  (3)
Hi all, is there the possibility to shift a portion of code in an .mqh file, in order to obtain a smaller .mq4 file? I'd like to shift in a .mqh file the part code in which I create the Global Variables, but I don't want to create a single .mqh file for every Global Variable (using the return...
EX4 file must be compiled using #property strict directive. I am getting above error while uploading new version of EA to market for MT4. Can you let me know what I need to do resolve the issue.
  Volume function  (1)
Hi, int start(){Alert(iVolume(NULL,1,0));return(0);} This simple code will print number of ticks on the current M1 Bar in a box near the chart. It works fine when I attach the ea to any chart However when I run it as a backtest with "Every tick" it prints huge numbers like 38654705672 in the journal...
  MT4 Scale Fix  (5)
HI , could you please assist me on this issue ,  when i fix the scale one to one in mt4 for D1,W1,MN period the chart will be distorted and you can not read it. i mean the bars will be very long and it will not fit the screen , the opposite for H1 period. thanks in advance.
Hi, I'm editing MACD Sample, using H4 AUDUSD, I want to use the entry conditions supplied, but i want to delay it by looking for a correction in the trend then enter. I used an input called 'Lookback', created a for loop that loops for i=0 to Lookback. The Problem I set the Lookback to 5, it will
[Deleted]
Hi coders, I made an indicator which should show an alert every minute. That works fine but when I change timeframes, it immediately shows the alert without waiting for a new m1-bar. I know this happens because the static datetime variable is initialized with a change of a timeframe. But I want to...