Download MetaTrader 5

MQL4 and MetaTrader 4 - page 4

To post a new topic, please log in or register
With the following code I cant see why I'm getting order send error 130? When I test on my broker vipromarkets it is bug free but when I take it to auto validation it returns ordersend error 130. Why is it the first code here works okay with no bugs :          if(OrderType() == OP_BUY)...
void start(){//Find Moving Averages  double fastma, slowma;  double total;  bool ticket;  fastma = iMA(Symbol(),0,5,0,MODE_EMA,PRICE_CLOSE,1);  slowma = iMA(Symbol(),0,8,0,MODE_SMA,PRICE_CLOSE,1);  total = OrdersTotal();//Start operations if(total < 1) {  if(fastma > slowma)   {      ticket =...
I have done a great EA which gives me excelent results when simulating on strategy tester of mt4. On real account it doesn't give me the same results...
Hi,guys. It's first time posting the theme. If I broke the rule, plz tell me. I am a C programmer, and I don't know where the entry point is(it's main() in C).  For example: //External,variables extern double LotSize = 0.1; ... ... // Global variables int BuyTicket; int SellTicket; ... int...
I have develop 5 Expert robot, and this one is good one, but need your help. I have develop expert base on bars patterns.  following tutorial : https://www.tradingsetupsreview.com/10-price-action-bar-patterns-must-know/ Now some patterns return good result, but some return always in lose... Pattern...
Hi All, I am creating an E.A based on IADX. When +D1 is greater then -D1 then it will buy and vice versa. my problem is when i integrate this E.A on chart it directly place buy or sell order based on these condition no matter where current trend is, like. if the buy trend is nearly to end no matter...
  Indicator Miscellaneous Questions (125   1 2 3 4 5 ... 12 13)
Hi, #Broker Time   I spent few hours for reading some comments, but I did not figure out how can I set my Broker Time to my indicators / how can I set my indicators to my Broker Time. (maybe I confused) My Broker Time starts from 01:00, but all my indicators works from 00:00. So how can I solve my...
Hallo, I want to add my "close all trades" script to my indicator, can someone explain how to add the codes to my indicator ? thanks
Here is an attempt of a code snippet to backtest indicators for BO. You can implement it into any indicator and backtest the signals. Attached is an example for testing signals given by RSI 7 overbought and oversold for 15 minutes expiry.
  PipsChart (55   1 2 3 4 5 6)
I posted this elsewhere, there wasn't much interest, so it should be safe to make a thread of it... The PipsChart indicator draws bars based on the pips movement rather than time, to only make a new bar when price moves far enough from the opening price. This is similar to a Point&Figure chart, but...
Hi there,  I am attempting to validate my EA for the market.  My EA trades only the EURUSD and it is required to be attached to the 1M chart. Why is the automatic validation checking for other symbols and higher timeframes? Is there a way to work around this issue?              Test report for...
Why an I receiving ordersend error 4107 and invalid takeprofit for ordersend function on testing the following code? extern string SECTION_C = "*** Trade Management ***";input int StopLoss = 40;  // Stop Lossinput int TakeProfit = 1000;  // Take Profitinput int TrailingStop = 10; // Trailing Stop As...
Tried using iClose, however it is only good for "candle close price", I want whenever it actually happened so as to be more precise. So I went the HLINE route, and cant find a way to just give me the last time the current HLINE touched the same bid price. Thought about drawing another VLINE on the...
if(OrderMagicNumber()==00000 && OrderSymbol()==Symbol() && OrderProfit()>(-OrderCommission()+-OrderSwap()))OrderModify(OrderTicket(),0,Ask,0,0); The above code sometimes nails it, sometimes doesn't. Maybe works right like 90 per cent of times or so. Sometimes misses the right moment, yet then later...
  Excess Printing (28   1 2 3)
I only want this to print the Spread to the Experts Journal when it places an order when the spread is low enough. Now it prints one every time (their is a Tick?) and more annoyingly, makes a sound. I want to fix it, not just eliminate the sound (< 8) Thanks for any and all assistance....
Did anyone have this issue too? I just recently spotted both FXPro and Tickmill Hourly Bar didn't close at XX:00. Instead it closes 10 minutes earlier before the hour. 
Dear All, I got some problem with my EA. Now it is in development phase. I run it parallelly with coding and updated version. But after the EA is running and opening some orders, after I updated my code and refresh it. It seems my EA can not continue working with existing orders. Anyone knows how to...
Hi! I have some COT data that I want to plot under the main price window as an indicator. The COT data are external data, i.e. independent of the prices. So one can not write it like a traditional indicator calculated from the prices. Since I have all the data needed, I don't need to do any...
  Simba Trades (65   1 2 3 4 5 6 7)
1-I would like to post a few live trades..just to follow the example of my friend cementman ..and enjoy the discussion..if any 2-Every week I will summarize the results for closed and open trades..let`s start,position sizes are for an account size of 150k to 200k usd..Do them exclusively on demo.....
Hi, where is the RSI in the MT4 app? Cannot find it... Regards
void OnTick()  {   //Code should only be executed once per day (at the end of the day)   static datetime oldtime;   if(oldtime!=iTime(NULL, PERIOD_D1, 0))   {      stronger("EURUSD");                 oldtime = iTime(NULL, PERIOD_D1, 0);   }bool stronger(string Pair)// Function returns True if it was...
Hello, could you explain why as I scroll back in the history, value of Bars increases? From the description I imagine that it would contain all Bars I can go back to. But when I load my indicator, I can see around 250 bars on my screen, Bars variable is equal to 3000. I start scrolling back the...
What do I need to delete or reset to get the current build of metatrader to save all it current display settings so that when I close and open MT4 I still see all the toolbars and navigator windows setting I had when I closed MT4?
Hi..... sorry for my poor english language... this Script https://www.mql5.com/en/code/1252.....Export all Symbol in Market Watch in CSV format... I want in the last column in CSV file ...the Script Write RSI Value... this Script https://www.mql5.com/en/code/273 Create indicator value Is it possible...
I would like to simultaneously scroll multiple charts with one command. Same pair in different time frames/charts. Is that possible? 
Hi, I am baffled. I was looking for a way to get the broker's commission of a symbol without trading it. For an open or closed position I do have OrderCommission(). (But why the hell should I go through the whole history with the chance to miss a symbol as it was not traded yet) Can someone please...
Hi  I have written a very simple logic based on ADX that is shipped with MT4. Code: double adx_previous = iADX(NULL,PERIOD_M15,6,PRICE_CLOSE,MODE_MAIN,1); //Previous Candle ADX Double Value double adx_current = iADX(NULL,PERIOD_M15,6,PRICE_CLOSE,MODE_MAIN,0); //Current Candle ADX Double Value...
Hi, I'm a newcomer to programming and MQL4, and I was wondering if some could help me with a piece of code? I've looked everywhere and the book/articles/google don't help me. I may have stumbled across the answer but because the code is so complex, and not relating to comparing arrays, I'm having...
Hi in my EA MT5 there are differents indicators and everyone can to be false or true. There are two CCI. Every CCI have setup for line buy and setup for line sell. If CCI line cross linebuy... buy If CCI line cross linesell... sell Is correct this ? :  if(cci(InpCCIPeriod2)>CCI2LineValueBuy &&...
I'd appreciate if someone could help me. Instead of using market orders with the stop loss and take profit internally coded in my EA, I want to try with pending orders with the stop loss and take profit embedded in them. The thing is that the OrderSend() function draws an arrow when the order is...
1234567891011...1223