Download MetaTrader 5

MQL4 and MetaTrader 4 - page 142

To post a new topic, please log in or register
I've created an EA which is supposed to open trades base on RSI values and should work on 15min time frame. But it doesn't recognize the 3AM candle on everyday so doesn't open any trade. I appreciate if someone kindly debug this code for me. If the RSI is above 50 at 3:00AM ET (15Min. candle close),...
You can use the iHighest () function to find the maximum level of CCI, in a number of candles?
Hi, I've been woring on an ea with a SL function that is set after a period of time has elapsed AND an amount of pips profit it cleared.. it works for OrderModify OP=BUY but not for OP=SELL, I think I'm just missing something simple but cant seem to grasp what it is.. anyhow, here's the code;...
Hello, (first at all sorry for my not so correct English) I'm using th function FileOpen and FileWrite like this codes:   int filehandle=FileOpen("datosbloque2.csv",FILE_WRITE|FILE_CSV,"\t\r"); //  FILE datosbloque2.CSV          if(filehandle!=INVALID_HANDLE)          {...
Puller28
Hi Could anyone tell me why when I run the below in MT4 back testing, the EntryLevel and MA10 values are 0? When I attach the EA to the live chart, and I check the journal, it contains the correct values for EntryLevel and MA10, but when trying to back-test, it prints 0. It also contains the...
I have opened 3 charts  : EURUSD GBPUSD & GBPJPY. Apllied the ea to all 3 charts with different magicnumber. EURUSD & GBPUSD do take autotrades of my ea but GBPJPY doesnt. Can anybody help me why. This is an error i get from my experts tab: 2016.12.08 10:16:29.728 3 Tier London Breakout EA v1.3b...
  Trailing Stop (5)
Could someone explain how does trailing stop works in MT4? Mt4 provides minimum value as 30 points as trailing stop. What does it mean if the value is set for EURUSD at 1.07612, at what value will the sell trigger? Similarly for USDJPY it is set at 113.123 then at what value will it be sold?
I'm in a bit of confusion after looking through previous articles on encrypting MQL4 code... because it seems that many of the 'solutions' are susceptible to being cracked very easily by decompilers that are easily acquired.  My aim is to have my work not susceptible to being cracked by a decompiler...
when manual trading on mt4 you have to enter the amount of lots you wont to trade , is there a way I can get mt4 to automatically calculate the max amount of lots I can trade ?
using the command #resource  "Indicators \\ \\ myIndicator.ex4" and the code for inclusion in custom (), iCustom(Symbol(), PERIOD_CURRENT, "::Indicators\\myIndicator.ex4", 0) you can in the choice of the external parameter file .ex4?
[Help] SetLevelValue() - Switching To Other Time-frame Showing Unnecessary Lines/Maybe Lines in Previous Time-frame. This is bug in SetLevelValue(). If I switch to other time-frame there's an additional lines that appearing. For example: From M15 to D1 time-frame I see some lines from M15 that...
Anyone else having issues with EA's not loading unable to attach to chart?  I have V4 Build 1010 on Windows 10 (which did an update yesterday) and TrueTrend has gone all weird and none of my EA's will load.   Is this an MT4 problem or a Windows issue? Windows version is 1607 (OS Build 14393.187)....
Does this MT4 platform only run Forex ?  If not, would be grateful for advice as to how to add indices. Thanks  
Hello, i am facing a weird problem with my MT4. after installing any indicator in my MT4 i am getting the texts congested like the attached pictures. i have tried reinstalling the MT4 and result remains same. if anyone is already experienced the similar problem and solved please help me out. Thank...
Hi alltogether, I have a problem with the function Symbolselect (Symbol(),true): it always returns wrong!   I'm using a specially installed Metatrader 4 without any broker connection because I solely want to backtest my strategies here with well defined history data. I do not want to pollute these...
Puller28
  MT4 Backtesting 'Issue' ? (13   1 2)
Hi I wonder whether someone could help me.  I have written, what I consider to be a very simple EA but when trying to back-test this EA using MT4, the backtester seems to work for a few trades and then 'stops' (by running to the end without placing any further trades). It is almost like it runs out...
How to execute trade at the :00 minute of every hour? i.e. 1:00pm, 2:00pm, 3:00pm when conditions are met.
Good news is I'm trying to do this in only 1 way.  C# managed program to MQL4. Now, when the DLL code is this: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; using RGiesecke.DllExport;...
Hello everyone! Unfortunately the while loop you just can not make it work. I would like to run this code. the RSI to candle 1 must be above level 50, now start the while loop that will search the first candle back in the graph is below the level 30. But the desired result is not correct, where am...
Hey,  I´m just programming my ea and have some questions, I want to differentiate between pending and open orders, Since I´m working with pending stopporders and my ea is placing them he should keep looking look for signals as long as there are only pending orders open, but if there´s already one...
Hi, Why in the world does this _ticket=OrderSend("USDJPY",OP_BUY,_lotsize,NormalizeDouble(Ask,4),_slippage,_stop,_prof,_comment,_magic,_expiry,_arrow); always fail with error 4107 in my demo account?
  RSI Trendline (8)
I'm trading a system manually that generates exit signals via RSI as seen in the image below. How can I code an EA/Indicator to calculate a break in a trend line like this? RSI Trend Lines
  Ordermodify error 130 (13   1 2)
Hi, I have created an EA, that works well for me, but I tried to change it a little bit, but can not manage to make it work. All I want it to do is to open an order with a trailing stop. The problem is, the trailing stop is different for each trade (it depends on the high of the current candle). It...
  EA works only sometimes (11   1 2)
Dear Everyone!  I am asking for your help since i wrote a code which does the following: BUY: 4h candle falls below RSI,14=30 then on next 4 h candle on lower timeframe for example 5m everytime when 5-12 EMA crossover to up i buy TP 3 pips, SL 300 pips! Sell: the opposite of buy (RSI,14=70) here...
Hello, I am quite new to MQL and trying to create my first EA and I got some strategy where I need to calculate EMA. I am working on 15m period, EUR/USD, calculating on close prices. I got sheet with historic prices where I calculated EMA myself. However the result is different from what i get with...
Why my Indicator (SubWindow) "Object Button" not sticking on indicator itself? If I used my indicator in chart that already have an indicator in subwindow then my indicator object button is showing in other indicators. How can I change my indicator to remember the right place to put the object...
  A problem with iBarShift (16   1 2)
I want to get RSI value from H1 when I am on other intervals like M15.  I have a following snippet of code in onCalculate method:   int counted_bars=IndicatorCounted(); // Number of counted bars int barNumber=Bars-counted_bars-1; while(barNumber>=0)      { int h1BarNumber=iBarShift(Symbol()...
Im working on a simple 2 moving average EA where when the lines cross over it will sell off the last order and make a new buy or sell order depending on which way the lines crossed. Im getting quite a few errors when I run it, feels like im missing alot.    -orderclose error 4051 -orderclose error...
Why do previously drawn lines on a chart disappear when you leave a currency pair, go to another, then return to the chart that had the lines drawn? Rgds 
Hi, I'm trying to calculate one PIP price for closed position, and then calculate position profit, but results I'm getting always differ from OrderProfit(). Please help me correct my code. By PIP I always mean 1/10000 LOT price (even if there is 5 digits precision), I'm testing it in Strategy Tester...