Expert Advisors and Automated Trading - page 5

To post a new topic, please log in or register
Any help would be much appreciated. //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick () { //--- // Ask & Bid double Ask=
hi all, I'm a new member, Can you help me how to create an application for auto trading on MT5 ? Thanks all you
#property copyright "Adam"#property link      "https://mql5.com"#property version   "1.00"int bbHandle;void OnInit(){   bbHandle = iBands(Symbol(),PERIOD_CURRENT,20,2,0,PRICE_CLOSE);   }void OnTick(){   double upbb[];   double lwbb[];   double mibb[];      ArraySetAsSeries(upbb,true);...
I've been trying to check my open trade if there is an open trade then dont trade , i only want one trade to be open, I also wanna create a buy order but it doesnt work it gives me i "2020.07.09 18:11:45.128 2020.01.03 17:36:15 CTrade::OrderSend: market buy 0.01 @EP sl: 3017.35 tp: 3023.35 [
I'm writing an Expert Advisor that closes trades on his own, given a stop loss or a take profit using OrderSend. double tp = price + point * slTpDeviation; request.tp = tp; OrderSend (request,result) I have a boolean variable, that depends on whether or not the agent currently has an active trade or
Hi, There's a way to iterate over all indicators to remove them all? Thanks.
Hi, I am trying to have multiple copies of the same EA run in the same symbol with different magic numbers. I already found older topics that mention this but I did not find any solutions yet. I want one EA to know if for his magic number he is bought or sold, for instance. For this, I use: bool
Hi there, this code is triggered 4 times when I'm closing one position. It's important for me to do ( // do something ) in the following code only one time. But how? void OnTradeTransaction ( const MqlTradeTransaction & trans, const MqlTradeRequest & request
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 everyone! So I have a stop loss check in the Ontick function like this: Some part of the code is hide away for simplicity. //+------------------------------------------------------------------+ //| Expert tick function |
I'm offering one of my own EA creation for people who want to explore martingale type of system. Because this is written by me, so it would be relatively easy for me to modify and expand it if I see the requests. I have written a lot of grid system for people in the past, some are martingale, some...
I'm working on an Expert Advisor which sets the filling type on orders according to broker's available types. I'm using CTrade class for opening positions. CTrade myTrade;bool IsFillingTypeAllowed(string symbol,int fill_type) { int filling=(int)SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE);...
Hey guys, My recent optimization results are not what they seem to be. When double-clicking an entry in that table, both backtest and a visualized strategy run yield a totally different result (results of backtest and single visualization test match). Not only the profit is mismatching, but also the
My code below draws a rectangle based on certain conditions. I want to add another condition for drawing the rectangle. The rectangle is drawn from the open to the high of a bullish candle with index (i+1) as shown in the code. How can I tell if : price has already reentered the region price has
Anyone see the optimize parameters disabled in b uild 2458 ? No matter what setting I put in backtester the optimization parameters are disabled. Cannot select expert and cannot change optimization parameters
Problem with my EA is how order send works in MT5 Order send is generating a error as follows Takeprofit & stoploss are set to zero / Start balance is 1000, leverage is 1000 , and here is the code #include <Trade\Trade.mqh> #include <Trade\PositionInfo.mqh> CPositionInfo position; CTrade trade; void
Hi, I'm trying to retrieve the new price property from a object (horizontal line) after it's dragged, but it returns the old value and not the new one. Am I doing something wrong? How to get new new value (price to where it was dragged to)? virtual void OnChartEvent(const int id,const long...
Hi, My VPS shows a nice ping with my broker, but sometimes ... there's lag. So I want to be able to check the ping, TERMINAL_PING_LAST do it. But in which circumstances does the terminal ping the server ? Plus, if only when connecting, is it possible to reping it ? Thanks
Hey so I have coded an expert advisor but I am having an issue with initiating a part of the code correctly #include <Trade\PositionInfo.mqh> #include <Trade\Trade.mqh> #include <Trade\SymbolInfo.mqh> #include <Trade\AccountInfo.mqh> // Spread out the orders of open trades by counting down the
Hello all Recently I bought my first indicator. Now I want to try to make an EA of it, so I can put in when to buy or not to buy. On the internet I found out that it's possible to make an EA from an indicator that has the mq5 file format. The indicator I bought is from the ex5 format. Thanks in
I'm not a coder, but I'm thinking of having an EA coded based on a repainting indicator, but it only repaints when it's refreshed. From what I understand of EA's based on indicators, they refresh the indicator every tick, which in this instance would not be desirable. So, my question is, is it
I managed to get input from a built-in indicator, so now I wanted to try with a custom made indicator. I downloaded an indicator off the internet and put it in MT5. It successfully shows the values in a buffer. [picture of the indicator with buffer.] (For some reason it doesn't accept my link. But
Gents, I'm currently playing with the new bar event handler lib (https://www.mql5.com/en/articles/159). My goal is to simply draw a green arrow_up on a new bar. This is for testing and familiarising only ;-) However, I'm seeing a lot of strange things happening: 1. Although the log shows that a new
[Deleted]
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...
I found the indicator MS-Candle-Index ( https://www.mql5.com/ru/code/24254 please refer to the fixed SmoothAlgorithms.mqh at https://www.mql5.com/en/forum/321609 ). How I can use the indicator to access the strength value of the last closed candle (i.e index 1) of a given timeframe within my EA
  Requests & Ideas (MQL5 only!) (558   1 2 3 4 5 ... 55 56)
Terms and Conditions: You describe (you provide) the idea. I place an open MQL5 code in this branch. I place this code in a CodeBase. I specify the author of the idea and the author of a MQL5 code in a code. The coding services are provided "as is" and you use them at your own risk. List of ideas
Hello, I'm playing around with my first advisor. I am using a stochastic indicator. I created the handler for it: stochastic = iStochastic ( Symbol (), PERIOD_M1 , periodK, periodD, slowing, MODE_SMA , STO_LOWHIGH ); And now I want to get the values for Main and Signal. I read about
Hi all, I was wondering on how to add an indicator to the dropdown menu in the expert advisor generate paramenters of signals module. You can find attach the pictures. Let me know! I believe a lot of people have the same issue
Hi all, I have this code for the moment : double HigherBar = iHighest ( _Symbol , _Period , MODE_HIGH , 100 , 0 ); double LowestBar = iLowest ( _Symbol , _Period , MODE_LOW , 100 , 0 ); double HigherPrice = iHigh ( _Symbol , _Period , HigherBar); double LowestPrice = iHigh ( _Symbol
Hi, As said in the title , I would be curious to know if mt5 would recognize and be able to use two processors (like 2 * intel xeon as example , seems the most common for dual processor config,) for optimization ? It may not be that useful because 1 better processor could be as powerful ,and as a