Expert Advisors and Automated Trading - page 212

I know I can go into debug mode and then set up break points in the code, however I was curious if I can set a break point at a certain time in the chart (for example 6 Apr 11:50). Is it possible
I am struggling to find a way to make the horizontal line only start from the bottom of the candle and go out 4 bars instead of infinite I also don't know how to place horizontal lines at each of these conditions instead of it repainting, I would like it to hold its location and just spawn a new one
Hi guys. Im kinda new to coding EAs in Mql5. But i am trying to get the absolute values of variables, mainly my 'Loss'. I know that the MathAbs() function can solve the problem but i don't know how to execute it. Here is where i am at: double Loss = (1 + total pips for loss) double MathAbs ( double
Hi! When there is no new servidor data my code doesn´t seem to work: datetime timeCandles[]; datetime time = D'2020.07.10 15:30' ; //+------------------------------------------------------------------+ //| Script program start function |
So i try to place an order with mql5 it gives me an error 2020.07.10 13:25:30.158 2020.01.03 17:32:36 CTrade::OrderSend: market buy 1.00 @EP sl: 3016.35 tp: 3022.55 [invalid stops] double SL = (Ask - 2.4 ); double PT = (Ask + 3.8 ); if (price > above) { if (runningmacdsignal > 0 ){
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, 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
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 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
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
  issue with code  (2)
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
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
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
[Deleted]
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
  ask  (1)
why when downloading ea can not from the browser, there is writing like this