Expert Advisors and Automated Trading - page 27

To post a new topic, please log in or register
Hi, This adaptation of the Edit example code populates the Edit text with the spread when the EA loads, but I need it to update the text with the current spread with each tick. I found solutions using the old object oriented approach but not the new object oriented approach. I tried updating using
Hello All, I'm sure the answer is buried deep within this forum and I have attempted to look just didn't find anything I might be able to use. Well any ways. Here is what I am trying to do. Basically once an order is closed I want the take profit booleans to be set back to false that way the current
MT5 strategy tester shows a max of 10,496 steps, yet some times it doesn't even make it to that number when testing and sometimes it will go beyond but it NEVER tests exactly ALL the inputs steps. Does anyone know of something that will test exactly ALL the input step settings of your EA
I wanted to incorporate trading at certain times in a different way into my EA and was wondering if possible I could change the timeframe and settings my EA works on depending on the time? Thanks :)
Hello, Anyone can help me on solving the the warning message of "Posible loss of data due to type conversion" on the lines highlighted below: void updateVolume(){ long OneDay=60*60*24; datetime
Hello friends i'm trying to creat an EA that is based on pending orders and now the problem is I want all pending orders to be cancelled after 5 minutes of being placed or to be cancelled if they are not yet open orders so please help with the expiration #include <Trade\Trade.mqh>CTrade trade;void
i am trying to make an EA for auto risk calculation but still not successful. i am trying to calculate risk from Stoploss value in pip. Example my stoploss is 10pip &amp; i want to take the risk of 5% of my total Account balance. it should calculate from these two parameters... Here is my code i...
Hi! Which is the fastest way of getting the current price? Option 1: double close[]; if (CopyClose(_Symbol,PERIOD_CURRENT,0,1,close) > 0) Option 2: if (SymbolInfoDouble(_Symbol,SYMBOL_LAST)) Option 3: if (SymbolInfoTick) Some other option 4 I would bet in Option 2, but I'm asking just to be sure. :)
can someone help me to add time filter in my ea
Hi, I'm new to programming in MQL5 (and programming in general). I'm currently writing an expert advisor, and I need it to open multiple positions at once for the purpose of scaling out and adjusting positions. My MT5 is in hedging mode. I've figured out how to use cTrade to open positions. But what
hi, I'm new for ea coding, and trying to learn from internet, but I cannot find out how to solve my problem. I want to change time frame on my ea 2 times but it's like keep looping when I run it, Could someone help please? thank you in advance. int OnInit() {//---
my ea sometimes does not start trading. After a while it return to normal.I suspect vps hosting. there may be a disconnection problem. How can I find out whether the mt4 program has been restarted or the vps hosting has been restarted. why this may be the problem
Hello I have the attached indicator which sends alerts in case the candle closed above/below a certain price. As a first step, i would like to create an EA that opens a position based on that alert. What i want to achieve is to make the EA that finds the high and low during the Asian session and
  Magic Number (2)
Hi, I use an EA with Magic Number stand alone, so I can use the same magic number for all the instruments. I know if I put an order manually its Magic is 0, but can I use 0 in EA ? So if I openn manually, the EA can manage also my order? Thk
Hi traders, I'm looking for EA that closes a open trade when the market breaks a price (added manually) based on h4 candles, do you know something like that? thank you very much
Hey guys, can someone explain me the idea behind this code? double NormalizePrice(double p){ double ts=SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE); return(MathRound(p/ts)*ts);} Can it not be simply replaced with this? NormalizeDouble(value, Digits()) Help very much appreciated
The example code at works fine for me (v.5.00 build 2302) but when I change the minimum, maximum, and current value parameters from 10, 100, and 50 to numbers with a decimal (e.g., 0.00001, 0.00010, and 0.00010, respectively), I get the
god i hate MQL5 everything is complicated compare to MQL4 anyway guys i tried the sample of ifractals here is the code double fractal_up[],fractal_down[]; //--- for collecting fractal data handle_fractal = iFractals(_Symbol, PERIOD_CURRENT); ArraySetAsSeries (fractal_up, true); ArraySetAsSeries
Hi everyone, how can I properly check if the following code returns correct price value ObjectGetDouble(ChartID(),"Line",OBJPROP_PRICE,0); other than checking if it is bigger 0? Thanks
Hii am working to build my expert and want to Hide input tab window from users , while all variable parameter are active in hidden ? thank you
It gives me this error when I try to do a backtest on IcMarkets BuyPositionOpen(): Incorrect data for a trade request structure! BuyPositionOpen(): OrderCheck(): Specified type of order execution for the balance is not supported
My coding is using IsNewBar function as below; After compiling, there is an error message that 'IsNewBar' - function must have a body What should I modify for my coding?? input double Lotsize=1.0; input int Slippage=10; input int Stoploss=30; input int Takeprofit=30; input int MAPeriod=20; input int
Hi All, Having a funny one with a super simple EA and I'm not sure exactly what the matter is. In principle I simply want to execute a buy trade when the current market price (Going by the Bid) is greater than previous day's high, and also the other way - selling when lower than previous low
Hi guys, writing an EA that accesses signals from indicators comes with the task to fill their parameters when creating their handles. Because I am not integrating all of these indicators in an EA - I have to re-define all parameters of these indicator in the EA. A brief example to outline what I
Hi; anyone know how close all graphs at same time? tks
void Long() { if(MathAbs(MaxLossPerOrder) > 0) { for(L_Count = OrdersTotal(); L_Count >= 0; L_Count--) { RefreshRates(); OrderSelect(L_Count, SELECT_BY_POS, MODE_TRADES); if(OrderSymbol() == Symbol()) { if(OrderType() == OP_BUY && OrderMagicNumber() == LongMagicNumber && OrderProfit() <=
Good morning I started studying MQL about a month ago and I have had a problem in which I have tried to solve in many ways and not succeed. The problem itself would be to make the arrows plotted on the chart (with the market open) track the candles when these are in the opposite direction (image
I want to get price of last order to calculate something, how to get that price of last order (ticket)
Hello everybody i was creat EA and try for run in all pair in MT4 but EA only show text (Drawdown ) calculate in 10 chart and no more. anyone explain to me and how to fix for all pair ? CALCUL button blue is working , red is stop . when (Total playing now ) is counting so (drawdown ) calculate
I want some suggestions from developers.I can make EA profitable by Grid systems but I not get profit conditions in indicator EA.What concepts need to build profitable EA by these **** indicators.Do you have some references links. Thanks