Expert Advisors and Automated Trading - page 119

Hello! I would like to obtain the maximum and the minimum price of an asset from a specific time range, lets say I want to obtain the max and min between 0:00 and 06:30 AM. How can I retrieve that? Thank you
Hi, how can I get the value of the stochastic ? I'm using this: int iStochasticResult1 = iStochastic ( _Symbol , PERIOD_CURRENT , Signal_0_Stoch_PeriodK, Signal_0_Stoch_PeriodD, Signal_0_Stoch_PeriodSlow, MODE_SMA , STO_LOWHIGH ); //- is a function that returns the symbol name of the current
hi community, I cannot open position with SL direclty. [if I entry the value as 4th position - system doesnt accept] if (!trade.Sell(lots, NULL , bid, 0, 0 , "comment" )) Print ( "error on sell open position" ); so I add BuyStop afterwards: if (!trade.BuyStop(orderLots, buyStopPrice, _Symbol
  strategy tester  (6)
Hi all the strategy tester always stop after two week (no more than 10 days of strategy simulation even if i asked to simulate the strategy on 4 may to 29 may ) anyone know why? which are the limits on data calculation? thanks
i having an few problem which is first i change abit an code then the EA cannot start trading anymore , the journal is running the chart only , second issue is if opened an buy/sell order,then closed order will direct open another order, my code to trigger open trade which is refer RSI indicator
I have written my first trading robot using mql5 and tested it on the demo account AMP Futures have provided. As I was trying to run the robot on the live account all the pending orders have been cancelled immediately after being accepted by the trade server. So I have written a small piece of code
Hello everyone, I want help how can I code an EA that open a lot 0.21 then close the partial profit or loss of 0.20 instantly then let the remain lot size of 0.01 to run until take profit ? I want all my position to be opened this way. Thanks in advace for you reply
Hello everyone. Is it possible to set up/create an EA that "never loses money"? I've recently stumbled upon such a thing but it simply looks too good to be true. Does anyone know of such system? Any recommendations? Thank you
Hello everyone, I have recently designed an automated trading software for myself and encountered an issue during live trading that I would like to share and seek solutions for. When I use the Virtual Private Server (VPS) provided by the MQL4 platform, my trading positions are automatically closed
#include <Trade/Trade.mqh> CTrade trade; input int stoploss = 5 ; input int takeprofit = 3 ; int candleG; //+------------------------------------------------------------------+ //| Expert initialization function |
Hello everyone , i wondered if i could get some assistance or suggestions here, Im very new to coding and have been studying it for just 5 weeks i have wrote a code which works more or less, one problem with it is that sometimes it will enter two open positions. For example it can buy to open a
hi everyone, hope you're well I found this function on this video here from @ Tobias Christian Witzigmann , can you confirm that the variable previousTime is read only once with al static function ? bool IsNewBar(){ static datetime previousTime = 0 ; datetime currentTime = iTime (
hey there, i am trying to work out how to draw a line on the opening price of a range i have defined in my EA. I am able to draw the high of the range in green, the low of the range in red... but i cant figure out how to draw the actual opening price so i understand the concept if the lastTick.time
I can't seem to find a clean piece of code to continually place the same order after it TP. Should the magic number be used? Example: If the buy order triggers at 5 and takes profit at 8, what would the code be to immediately place another buy order at 5. And if the price keeps going up and down as
Hello everyone, im struggling with backtesting EA. Normally when I backtest with visualized chart, it will run through smoothly. But with the code below, it doesn't do it quickly any more. Even if I just run the backtest without chart, it will eventually disconnect and stop the test after a few
Hi. How can i get the same function as OrderLots() in mql5? Alternative
I can't pass the MQL5 validation test for my EA. It keeps giving me this error. test on EURUSD,H1 (netting) 2020.05.26 12:02:03 failed instant sell 5 EURUSD at 1.09610 sl: 1.19611 tp: 0.99611 [Volume limit reached] Even though I checked the max and minimum volume for trade and also checked lotstep
hello is it possible in mql5 to set a different magic number for each position ? i searched but i cant seem to find how can i do it anyone can help on this ? thank you
  How to delete pending order?  (13   1 2)
Hi: I have this first loop which scans for open orders and pending orders. If there is an open order and a pending order, I want to delete this pending order. What codes should I use below? int PosTotal=PositionsTotal(); int pnd=0,opn=0;&nbsp;&nbsp; for(int i=PosTotal-1; i>=0; i--)...
I have a JSON string that I'm trying to use to make a webrequest string json = "{\r\n" "\"time\": \"2023-06-06 10:00:00\",\r\n" "\"type\": 2,\r\n" "\"volume\": 0.02,\r\n" "\"stoploss\": 1.2000,\r\n" "\"takeprofit\"
hi, unfortunatelly cannot get this information from CDealInfo. https://www.mql5.com/en/docs/standardlibrary/tradeclasses/cdealinfo i will be very glad for a small exaple. regards
I have used this line of code to open a long positions, and it works well: trade.PositionOpen( _Symbol , ORDER_TYPE_BUY , 1.0 , SymbolInfoDouble ( _Symbol , SYMBOL_ASK ), 0 , 0 , NULL ); However, when I try the same thing with the short positions, no sell position is opened: trade.PositionOpen(
Hello, I have a complete python-project that calculates signals for a history of data. For simplicity lets say I have a class like that: class PythonSignal: def next(self, price_data) -> int : signal = ... # do some calculation on my state and the specified data
Hi, I've never used any of the Metatrader software packages before but have decided to make the leap and give MT5 (demo - AlpariUK) a try. I downloaded an EA from the Code Base and put it in the Experts folder. When I re-start or refresh MT5 the EA dosn't show up. Is this because its only a demo...
hi guys im new in mql5. how can i modify a position in mql5 with out classes
Hey Guys, I rented a VPS last week. I want to change broker this week, can I use this VPS then for new broker? I rented 3 months... Thank you for help guys
2023.06.01 20:13:41.782 '4117408': order #67975146 buy stop 0.02 GBPJPY.pro at 174.085 activated at price 174.090 2023.06.01 20:13:41.782 '4117408': order #67940641 sell 0.02 GBPJPY.pro at 172.947 closed due stop-loss at price 174.090 Note: order numbers change when a pending order is filled. I
Hello, dear friends and experts. I have an expert advisor that works based on the the Trix indicator crosses. Its main part is coded as follows: //+------------------------------------------------------------------+ //| Expert tick function |
Hello everyone, I am trying to modify pending orders with order tickets, The problem is that if I attach the EA on 2 or more different charts order tickets are mixed and this is a problem, can someone help me? below is the complete code of the logic. //---4 Count total orders placed by the EA on
To whom it may concern, I am facing the issue that apperently demo versions of market EAs (provided via mql5.com market) are incapable of writing files to the common/agent folder. To demonstrate the issue I wrote an EA, which I uploaded to the market ( https://www.mql5.com/en/market/product/97058 )