Expert Advisors and Automated Trading - page 91

To post a new topic, please log in or register
I coded a basic price calculation for an MT5 oscillator and it calculates correctly you can see after the second vertical line, the value is 0 to the end the problem i have is that it stops 10 candles early and i really dont know why it does this...
Hi all, I want to create some functions to return some signals and put them in different files to have more order in the void OnTick() function. So my problem is this. In another file I want to declare the function like: int fun_to_declare(double *array) {//some thing to to} And in the main ,...
Hello All ... I'm doing mql4 coding since the early days of the language ... Since few months I have been thinking to post this or not ... It is not personal to any coder here as I believe it is a fact that all must take care of it ... (correct me, if I'm wrong !) ... You may noticed that 10's of EA...
Hi, So you might question as to why I would want to do this? I have a very sensitive (time/price) EA on MT5, but it doesn't fire very often, so I want to use the funds in that account to be used with some MT4 EAs and Signals. I have found a MT4 -> MT5 copier, but it synchronizes so any trades...
Hello, whats a good way to check if a specific lotsize (lets say 0,11 lot) is allowed on a trading account? It works on accounts with MODE_MINLOT = 0.01 (or 0.01) and MODE_LOTSTEP = 0.01 but e.x. would not work on accounts with MODE_MINLOT = 0,1 and MODE_LOTSTEP 0,1. The next accepted value would be...
hello, with MT4 the issue is clear by addressing iCustom(.... [1]) Bar 1 instead of the latest Bar 0 for example. How would one get - previous -  values when an MT 5 EA is using a code like, let's say GlobalVariableGet("Indicator_EURUSD_5_CURR"); this code shows the latest value. But the Bar [1]...
shodee245
Hello, please i need help for the mql4 code for ea to open a second order when the first order is having some points in loss.. 
I'll start... I've been chasing a bug for hours and felt I'd share my new-found wisdom... In case you aren't familiar with scope resolution - you might have run across some code where the function name is prepended with two colons and wondered why... string symbol = ::Symbol(); This resolves...
I was looking for a way to create a combo box for the input variables.  I came across the following example: enum __in{    _p1, // value 1   _p2, // value 2   _p3, // value 3   _p4  // value 4 };extern __in check = _p1 It works beautifully and I have adapted it for my needs.  My question is...  What...
I have the problem that when i run a backtest​ in strategy tester​  ​​on a new installation of MT5 using the standard sample EA called "MACD Sample.ex5" i get no trades on my demo account with FX.COM. I have attached the EA. The EA is unmodified and comes with FX.COM standard install for MT5 for...
Hi, I used ObjectCreate to put some objects on the chart within the strategy tester. However, TimeCurrent and the bid price seem to have no effect. I want the objects to move with current as well as the bid price but they remain static. Any ideas? void OnTick() {    ObjectCreate(0,"test9999"...
i Got a problem when i test my EA at backtesting. anyone help me about this error? Label Delete: failed to delete a text label! Error code = 4202 Regards.
hi guys, it happens my pc get frozen and i ve forced to reboot it... Anyone has experimented it? Im using EA on MT5 Thanks
Hello, im trying to use this indicator -> https://www.mql5.com/en/code/11432 inside of my EA, but via iCustom i cannot obtain the candle result, how i can export data from this indicator to the iCustom ? if possible can you provide me an example of iCustom call ? I tried to add an buffer and store...
I want expert's properties appears when user clicks on the properties button on the chart, i know how to design and code it, i just don't know what function shows EA's properties, can someone help me please
I need help on this. I want to add some coding to my EA. I need to add new same order as previous when equity drop to certain amount. Really appreciate your help.
  Heikin Ashi (1)
Can anyone tell me how to detect when the trend direction changes from within an EA?
My cashmarket trailing stop applied to Forex is failing, sending this error code: 10036 - Invalid return code of the trade server Anybody with some clue? Thank you. Daniel
double margin = AccountInfoDouble(ACCOUNT_BALANCE);double tickValue = SymbolInfoDouble(pSymbol,SYMBOL_TRADE_TICK_VALUE);double tradeSize = margin / tickValue; Initial money: 100,000 SYMBOL_TRADE_TICK_VALUE = 1 SYMBOL_TRADE_TICK_SIZE = 0,00001 Ask Price = 1.11225 Running the code above I'll get a...
liberssky
I wanted to try optimization in the cloud today, deposited 10$, setup all optimization parameters, turned off local cores and local network and when I hit start I get an error 2017.05.21 14:27:26.124 Tester  no agent is ready, optimization not started The optimization does work using local cores,...
Say I have an EA that execute based on tick level (Bid Ask) information, is there a way to backtest it with tick level information in metatrader? There are two problems: a. it seems metatrader only supports 1 min chart and tick level are simulated (not accurate) b. where could I get the tick level...
do some body have the template for inserting magic number in EA i have an EA and i want to insert EA to avoid closing my other open trades
guimf
Hello,  If I have multiples orders executed in the same trade (same direction) to do averaging price and I would like to get the price of the last order executed, not the final price (average). How can I get this value? I tryed to use the function bellow, but this function give me the price of the...
mar5
Hello all, can somebody tell me why this small script returns totally wrong numbers when applying it on a timeframe > M30? void OnStart()  {   Alert((string)_Period);  }
I have made a very simple EA and it gives me notification. However, after one to two hours, it just stops and my terminal is still open. Anyone have any idea why? Other EA are also like this. My code is as following:...
guimf
I would like to know, how to round a number and keep the last digit only 0 or 5. For example: Round (104,5) = 105 Round (102) = 100 Round (211,2) = 210 
about mql5 string function For example, before: string testr = "macd,9,13,26"; after: testr1="macd"; testr2=9; testr3=13; testr4=26; Here need to work with a long string with several ","(or others like "-")characters within it and then divide into different short strings, the number of short...
I am converting my code for mql4 to mql5. In mql4 i had a ticket of trade i selected it from history and was able to get pips gained. In mql5 i am able to select that order using ticket HistoryDealGetDouble(ticket,DEAL_PROFIT); but profit is 0 because ticket of deal out is different , how to get...
Hello I'm looking for a pending order EA which places an buy or sell stop order X pips away from an order which was placed by another EA. e.g. EA1 opens a long position. This leads the pending order EA to opening a sell stop order X pips away from the opening price of the long position created by...
I'm running a EA on WDO$D and when I try to get ask or bid values, to open position, both are zero! The value variable is zero when I use SymbolInfoDouble and SymbolInfoTick.    double BuyPrice(){      double value = SymbolInfoDouble(symbol, SYMBOL_BID);      if(value == 0){         MqlTick...