MQL4 and MetaTrader 4 - page 580

In a static StrategyManager class I want to have a static array of Strategy Singleton classes who's functions i call depending on the current market's behavior. The static functions like OnInit() in the StrategyManager class are being called in the Expert's mq4 file. When I try to compile this, the...
I know this is a common thread but I'm trying to modify my market order to breakeven (adding a stop loss to be equal to the order open price) when I make 100pips profit. Everything is NormaliseDouble'd & there's even a mechanism that continues onto the next order select in the pool when a stop loss...
Since build 900 allows us to make parametrized classes I was trying to find a way of creating a Singleton base class. There is nearly no information about Template classes so i tried to mimic c++ kind of template classes. template < typename T> class Singleton { private : static T*
New article Calculator of signals has been published: The calculator of signals operates directly from the MetaTrader 5 terminal, which is a serious advantage, since the terminal provides a preliminary selection and sorts out signals. This way, users can see in the terminal only the signals that...
I can set the levels -150 +150 default within the code? //+------------------------------------------------------------------+//|                                                          CCI.mq4 |//|                   Copyright 2005-2014, MetaQuotes Software Corp....
How to convert a single char string to keycode ? For example for the string "q" I want to get the value 81 (as the keycode described here)
[Deleted]
I've seen a few threads about this and tried one of them, but it doesn't seem to be working.  The specific one I've referred to is:  https://www.mql5.com/en/forum/133366. The code that I'm using is: static bool IsNewBar;static datetime LastBarOpenAt;int start(){ if(LastBarOpenAt == Time[0]) // This...
[Deleted]
Hi Guys,            Here i going to list few tutorial site for beginners to learn programming languages.. These tutorial links are very useful and easy for the beginners to learn.. C Programming  Java Programming  C++ Programming  To Learn JSP   Java Questions   
Hello, is it possible to get email notificatios on desired/own topics in the forum? I cannot find this feature in the forum, my profile and settings. Doing a forum search provided answers like checking your profile for favorites, but didn't see those either.
the arrow doesnt show on live until i switch time frame , please help me . below is the codes. //+------------------------------------------------------------------+//|                                              signalindicator.mq4 |//|                        Copyright 2016, MetaQuotes Software...
Hi I've just noticed an H4 new bar at 00.09. Not 00.00? I must have missed something in the manual but nothing obvious is jumping out of google. 
Hi guys, i am new here so decided to ask about one issue in a new topic. I am looking for a good MetaTrader Api for C# which can held more than one forex broker. In detail, i am interesting to get many instruments prices from some brokers in one time. Cany you give me a piece of advice and suggest...
I am copying and pasting this from forexfactory because help might be better here: There is a customized volume indicator which needs to do the following: I want it to only show Volume bars for the corresponding price bars that made a high or low. 1. The price bar that makes a new high would have a
[Deleted]
Hello I have a function in my EA whihc has operate correctly for some time, until recently. When the function detects a very specific candle shape it returns a vale higher than 0. So here is the function call: if(Reversal(-1)>0){Alert"candle pattern found!");}if(Reversal(1)>0){Alert"candle pattern...
Hi, I have an expert advisor running on an instance of Metatrader 4, if I replace the ea's .ex4 file in the expert folder will metatrader get the changes automatically? I used to right click on the "expert advisors" in the navigator panel and click refresh, hoping metatrader would get the new...
[Deleted]
Hello everyone, I'm developing an expert advisor that uses the stochastic (h1) and sar(d1) indicators. I noticed that sometimes the indicators return 0.0. Why does this happen? Thank you in adance
I know there is a heap of discussion on the net about server time vs local time . The snapshot attached shows what is generally talked  about and it seems there is no one indicator that will solve the question. What will be helpful to any Meta User is the ability to point the cursor( pointer /...
[Deleted]
Hi, I try write the code with limitation of one trade per minute, but it doesn't work (perhaps problem is with logic). I tried many versions with break, Sleep(). Have anyone any suggestions? thank you. datetime mt=TimeCurrent(); datetime mtoop=mt-PERIOD_M1*60;   Print("mtoop==",mtoop);   // current...
i want to learn to code indicators and ea s what you suggest me to learn i mean C, C++,JAVA...........etc give me good suggestion to learn as soon as good. thanks
Hello comrades. Please how do I increase font size in the parameters of the function "Comment()"? Thank you in advance.
  Double to int  (14   1 2)
How do I write this function without "possible loss of data due to type conversion" warning ? int S10;int StepIndex(int PosIndex)    {       if(OrderSelect(PosIndex,SELECT_BY_POS,MODE_TRADES) == true)       S10 = NormalizeDouble(((Bid-OrderOpenPrice())/10*Point),0);       return(S10);    }
hi i am new in mql4 an i need to make an EA that get the Max and Min price in a period of time and as it goes. for example now it is 12:00 o'clock, and i need to check the highest price between 14:00 and 16:00 and if we would be in 15:00 , comment the max price in every tick. i write this, but it...
I have an issue when using several candle prices.If I use: Print(Close[33]); to print the value of a given candle, I get: 2016.05.04 11:17:55.733 Indicator - CADCHF,M15: 0.7507200000000001 This happens occasionally with some candles, not all. I've tried to limit the number of decimals, but still
HI How do I write that an variable is (or not) an integer, or my integer variable does not have value ?
Hey there,  this code crashes the EA with the message: Access violation write to 0x00000020 in '(...)EA.ex4'. WTF? string filename=NULL;string search="*";long handle=FileFindFirst(search,filename,FILE_COMMON);while (handle!=INVALID_HANDLE)      {      handle=FileFindNext(handle...
I was hoping someone could help me understand the strategy tester a little better (newbie here).  I've am using the OnTimer() function in my EA basically as follows:  - Every 1 second the OnTimer() function gets called  - I do stuff in that function  - After 10 iterations of that function (after 10...
[Deleted]
#property copyright "Copyright 2016, MetaQuotes Software Corp."#property link      "https://www.mql5.com"#property version   "1.00"#property strictextern int starthour = 9; void OnStart()  {  if ( Hour() == starthour)  {ordersendbuy();}elseAlert(GetLastError());  }void ordersendbuy(){double...
Hey there, on the one hand, it´s quite comfortable that MT4 allows for multiple logins, but it´s also a matter of security and can be a big problem, especially when we talk about EAs, Scripts etc. for support of manual trading. If a user has a VPS and a local system and if he uses both from time to...
[Deleted]
How to I type the symbol || for the or condition. I cannot seem to find that symbol on my keyboard. I tried many keys on my keyboard but can seem to get that symbol. Please help, thank you.
Hi,   I am trying to learn to code an EA starting with the basics using icustom and opening a position.   I am trying to simply open a position when the indicator signals long, if there is no position open. If there is to ignore....