Expert Advisors and Automated Trading - page 2

To post a new topic, please log in or register
how, i m trying to code EMA 14 to show in ATR 14 chart window i can do it in terminal by selecting moving leverage "Previous indicator DATA" but how can i code it for my EA #define EMAperiodATR 14int start(){ static datetime Time0; bool newBar = Time0 < Time[0]; if (newBar){
hello, folks my mt5 script is very simple, it read csv like this : void OnStart() {//--- string dt ; int file_20 = FileOpen("104782531.csv", FILE_READ|FILE_CSV,';'); if (file_20!=-1) Print("Error is",GetLastError()); Print(StringToInteger(FileReadString(file_20))); FileClose(file_20);
Have this code to get Breakeven from a deal: double Breakeven+=Volume*OrderLots; By the way, it doesn't work if there's just an order, so I set BE=OP as default. So how should I set the code to filter when it's more than one order on the same symbol in the same direction from a single chart? Tried
With regard to the code attach below, How can i make my EA close Losing positions before the wining one? int CloseAll(){ for(int i=OrdersTotal()-1;i>=0;i--){ if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){ int MN = OrderMagicNumber(); if(OrderSymbol()==_Symbol &&
I have an active VPS and run Forex-Combo on a Demo Acct. I need to connect to the MT4 Platform and get reports. FTP is the old tried and true method, but I don't know how to use it. Any help would be appreciated. Chris Fredericks
Does any one know if there is a way to check the Mql5 username of a logged in user? I realize that we can use the TerminalInfoInteger to retrieve a bool about whether there is a connection to the mql5 community using the TERMINAL_COMMUNITY_CONNECTION identifier and also whether there is any data...
Dear Community I'm trying to perform a partial stop loss for each position. I try to check if the initial order that opened the position has got the same volume as the position itself. The order and the position should have the same ticket right? If that is true, the position shall be partially
Hi dev's, if you are reading this post is because you probably faced the same "issue" while you were developing your EA's. Let me explain in details: I use to divide my EA's into different blocks: the one for logic, where you define the conditions to open the orders, the one for open: check the
Hi! I want call the "Network Rescan" inside of my EA, how i do this? Tks
I have studied EA and one question is challenge me. This EA is initialized with second argument "Period()" as showed below. I have tested with M1 chart. I supposed the refresh (check close and open trade) is about each minute... In the second block, I coded a signal, that is based each M5. In the
Below is the method I'm using to place an order after two minutes if it doesn't go through. I've converted the larger part of it from mql4 to mql5 using the documentation on migrating from mql4 to mql5. It's the commented part that I'm not sure how I'll change to mql5 since in mql5 send orders...
Hi there, I have an EA that generates offline charts in back tester in visual mode, so you can see other timeframes at the same time. I am having a problem of MT4 freezing when the speed is set to max (32). How can I fix this?
Hi All, I am developing MQL5 EA and woluld like to implement more quality and control with unit tests. Does anyone have a recommended library or advise to test EA code to identify bugs. For example, I use MACD indicator in code and had many issues as it was not working properly and gave 0 values....
When I use Meta Editor IDE, as soon as compilation finishes, the scripts gets removed / reloaded immediately in Trading Terminal. How can I achieve the same behaviour (reload / reinit scripts), when using command line compilation? I can nicely compile the scripts using command line compilation, but...
I want to write a generic MA crossover EA, it just buy when the Fast MA cross above the Slow MA , and sell when the Fast MA cross below Slow MA from . I watched a couple of tutorials on Youtube on how to do this. And this how I found they usually do it: double PreviousFast=iMA(NULL,0,14,0,MODE_SMA...
Hi fellow coders/traders I need help with the following code. I am trying determine that price has closed below the various SMAs in the past 18 periods for example. But the following caused my mt4 to hang. did I create an endless loop?                for(int i=1; i<19;){                   SMA20 =...
 hello everyone i am trying to choose a developer for my job in freelance section but i don't know how since the responded developers that appeared to me are unclickable like in the screenshot. this is my first order on the freelance 
Hello, I am developing own semi-automated trading solution with possibility to connect to MetaTrader platform. I use C# and MtAPI (http://mtapi4.net/) - this library provide connector between Expert Advisor for MQL and C# code; data transmission (real-time, history bars, ticks) works fine. But I...
Hi everyone, I am pretty new to the MQL5 platform. I built a custom indicator to identify Hammer and shooting star patterns on the chart. The indicator buffer at a particular index is filled with 1.0 after a hammer appears and -1.0 after shooting star appears. Everything seemed to be...
I want to open a second order when the price= first order's price + 5 pips I try to use Ask for buy, Bid for sell. However, these are not effectively.    if (contiditions are ok.);       {        openprice1=Ask;        Open Trade (OP_BUY);      }    if (Ask==openprice1+0.05)     {...
This is what happened to me recently. I was running 2 EA's on separate charts and within a time span of 1 minute the EA's lost over $1000.  The losses were small ranging from $1.25 to $2.50 each.  When I backtested each EA independently they showed overall winning behavior with high profit factors...
Dear All, I just rented my first VPS from MQL5 via my MT4 platform today.  I set up my charts with the EAs that I wanted to upload to the VPS as demonstrated on the video: https://www.youtube.com/watch?v=NGSHrX-QAOU&index=2&list=PLltlMLQ7OLeKRRhrpy-pZ6REWYUf6W3SV As near as I can tell from the...
Hello I'd like to know how to implement in my EA a code that selects all Open Orders that have moved the stop level above the entry price.  I'm thinking in something like this:  Buy Order: OrderStopLoss() > OpenOrderPrice() Sell Order: OrderStopLoss() < OpenOrderPrice()
hello @ all like in subject written i am using metatrader5 on a linux host. this has worked fine just until a short (can't say it precisely) time ago. but now there is no signals-tab anymore in the terminal-window. i've just tried anything like login to mql5.com in the metatrader-program an so on...
At the moment I have some very overly convoluted code which is repeating a process at different prices with different ticket numbers etc. I am a bit lost as to finding out a way to get the code to repeat, but at a new price (if this is possible?) Hopefully it is clear from what I have posted. The...
Hi! I am new in coding, especially in MQL5 There are situations, where price wont go up like hitting ceilings, but price[].high for several candles are not the same, but very similar. Is there a way to desribe in MQL5 this 3-4 candle block for EA? 
  Roffild's Library (30   1 2 3)
https://github.com/Roffild/RoffildLibrary Please do not delete or move this topic.
Hello all, I'm trying to build an EA that trade a London Breakout strategy, and I'm completely new to coding so bear with me. I also couldn't find someone asking this specific question already on a post. Now, the problem I'm having is that when the EA sets the pending orders at 3 AM I can't figure...
Hi, I have multiple EAs, if I put one on a chart, another one on another chart, all is same currency pair, EURUSD. Will two of them function separately well? Is there any limitation on number of EA (with different strategy EA and one on each chart) but SAME currency pair launched in the SAME MT4...
please what piece of code can i use to reduce this number 79.77739518770201 to four places of decimal, that is it will be 79.7773 I don't know whether MathCell can do it.