Expert Advisors and Automated Trading - page 11

To post a new topic, please log in or register
How does Drawdown calculate? What is the formula? Thank you
Hi,  I have found a lot of outdated codes on the form in regard to this topic. What is the quickest way to open 1 positon per pair? I'm using the code below which one open 1 pair and 1 trade but I wish to open 1 trade for each pair I select. Thanks if(((OrdersTotal()==0) &&...
            MT5 platform comes with a few pre-installed EA.One of them is good on 1H TF (ExpertMACD )   But the problem is it opens with 1 lot;I can not trade with more or less than 1 lot. Can somebody fix this problem    for me? It's even better if you can throw in the Time Filter. Thank you.
In MT4 to hide indicator during backtesting using this script inside EA : int init() {   HideTestIndicators(TRUE);   return (0);} How to write similar code in MT5?
I am implementing the EA with mql5. I would like to know how can I retrieve the most recent open position. As I am using buy limit and buy stop, it can't use the highest ticket number to refer to the latest open position. What function should I use? Could anyone please give any suggestion?
Hello, I bought an expert from  MQL5 market, I loaded it to my account and my friend's account. Expert is trading in my account correctly but it's not trading in my friend's account at all. Help me, plz.
I really don't understand arrays of class objects. If we look at this page we see the correct way to use an array of objects is to use pointers https://www.mql5.com/en/articles/351 CName* cname[10] but my working code doesn't do that, it uses an array like this  MyClass objs[]; and my code works but...
the code indicator im trying to pull from is this #property copyright ""#property link      ""//----#property indicator_chart_window#property indicator_buffers 2#property indicator_color1 Red#property indicator_color2 Green#property indicator_width1 2#property indicator_width2 2//----extern...
Hi, On every tick I am iterating through all my open positions, and depending on certain criteria I will close it or not. What puzzles me, if I start iterating through and say have 100 open positions and I close the 50th, what will happen on the next  - 51st - iteration?  Because I imagine the...
How can I remove orphaned buttons from a removed EA without using the EA that originally created them? Please is there a script or something, its driving me bananas. cheers
hello, can you help me please :) string CheckFilter(){   string filter="";   double myPriceArray[];   int VolumesDefinition = iVolume(_Symbol,_Period,VOLUME_TICK);    ArraySetAsSeries(myPriceArray,true);   CopyBuffer(VolumesDefinition,0,0,3,myPriceArray);   float...
ive been trying to make an indicator but am stuck on this one part. below is the code ive been trying    int i;    int limit = 100;    int test = 0;  int OnInit()   {    return(INIT_SUCCEEDED); void OnDeinit(const int reason)   {   } void OnTick()   {      int lowest = iLowest(NULL,0,MODE_LOW, limit...
Hi, I dowloaded new versions of an EA last week for two different computers. Unfortunately I had a problem with one machine (a VPS) and had to reload MT4 which wiped out the download. I then downloaded it again.  I had a similar issue when I changed the hard disk on my laptop to an SSD earlier this...
Hi I'm trying to start the strategy tester from the command line but I can't figure out how to specify the expert because it always says it cannot be found. This is the command I'm trying from a batch file: start "B:\MetaTrader 5\terminal64.exe" Expert=Advisors\Meine\test.mq5 TestSymbol=EURUSD...
Does someone know how I can make from my indicator that gives a push alert an automated EA which opens trades? 
Hi, How do I automatically estimate the ATR Low and High?
I'm trying to get open price from ticket number and I'm using CTrade library to open position. I can open the position with no problem, but I think I cannot select the openned position by the ticket I have. I have tried OrderSelect() function, but it return false with error code 4754 which mean...
Hi, If my ATR= 0.00087 and price: 0.69111 and I want 1.5% stop loss. How do I calculate this with EA? Is the following correct? Convert ATR to whole number from 0.00087  to 87 * 1.5 = 130 pips. Am I correct? if so how do I convert it to code. Especially the digit conversion from 0.00087 to 87, how...
I just bought a signal and it is now operating on my demo account and not on my real account. As you see I am a noob, but I need to ask,  can I change this setup to my real account? Or I need to pay again for the same signal?
Hi I have what I thought was a simple routine but it has some issues. #property copyright "Copyright 2019"#property link      ""// libraries included for coding routines#include <Trade\Trade.mqh> //#include <MovingAverages.mqh>#include <initmql4.mqh>input double lowend = 0.25;input double highend =...
I made an Expert Advisor that opens an order based on price compared to the Bollinger Bands, it sends the order correctly, but sometimes it ignores some bars and opens, or ignores all of them and waits for another trigger. Here is the part of code void NewOrder(){       int...
I need to make sure server always run smooth. How to monitor this with mql5 vps?
I am using sqlite database in my EA. When I force stop backtest process agent hangs and never accepts new jobs until I restart MetaTrader. I figured out that after force stop agent still keeps sqlite database file open. I've added file release in both OnDeinit and in destructor of database...
Hi All, I'm new in the vps EA thing, i still cannot win migrating charts onto vps, i get an error message DLL not allowed, even when i don't check on the expert advisor window, it says the EA that is supplied by my provider uses "wininet.dll" so i should remove expert from charts and try migrating,...
Hello, know someone how to change start date and  timeframe in strategy tester automaticly? I mean, when I finish test my EA I would like in Deinit function change start time and time frame of tester? Is it possible? On the forum I found simple code how to pause Strategy Tester from EA so I think...
Hello. My EA considers charts on 3 pairs (hard coded in source code) and than trades on eurusd.Can this kind of EA be backtested in MT4? Can MT4 read data from more pairs in backtest mode?  Lets say I run backtest on eurusd and in source code I specify that EA should look for data on other pairs as...
Hi, is it anyhow possible to load history data and do the backtesting on it beyond the year 1970? MT4/MT5 any suggessions where this might be possible elsewher? Thks Volks,
if (iLow(Symbol(),Aggregation,1)>iMA_(Symbol(), Aggregation, 15, 0, MODE_LWMA, PRICE_CLOSE, 1))      if (iLow(Symbol(),Aggregation,2)>iMA_(Symbol(), Aggregation, 15, 0, MODE_LWMA, PRICE_CLOSE, 2))      if (iLow(Symbol(),Aggregation,3)>iMA_(Symbol(), Aggregation, 15, 0, MODE_LWMA, PRICE_CLOSE,...
Hi, I am running two (or more) EA's on separate charts with different magic numbers.  I found that the first EA has its position closed based on the logic in the second EA.  How do I get them to run 100% independently. Just for example (without attaching the long code).  EA1 closes position based on...
Hi I have two potions opened. 1 buy and 1 sell.I want to close them at the same time. how do i do that using the inbuilt mt5 include codes? Thanks.