Expert Advisors and Automated Trading - page 85

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
what is the equal of this mql4 code in mql5 : double PointValuePerLot( string pair= "" ) { if (pair == "" ) pair = Symbol (); return ( MarketInfo(pair, MODE_TICKVALUE)/ MarketInfo(pair, MODE_TICKSIZE) ); // Not Point. }
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
hello, I'd like to run many test with different parameters and/or on different pairs automatically. for example I'd like to test my EA on EURUSD2012 and CADCHF2011 wihtout having to manually restart backtest at the end of the first run, in this way I could let my laptop work overnight and collect
  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 |
Hi, I ran an EA on Strategy Tester and it seems like the profit calculated for the trades does not match the lots and the pips. For example, as you can see in the picture there is a trade of 3.84 lots opened at 1.43611 and closed at 1.44403. This results in a profit of 2106.11 according to the...
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 )
This is the code , there is no error on compile but its not executing order on market price : // Input parameters input double RiskPercentage = 0.4 ; // Risk percentage per trade input double TakeProfitPercentage = 0.7 ; // Take profit percentage per trade // Global variables int MagicNumber =