Expert Advisors and Automated Trading - page 51

I wrote an expert that saves the information of my trades in a text file every few seconds. It works fine in the first few hours, but after a while it gives error 5004. My code: //+------------------------------------------------------------------+ //|
I have been using cloud network for over a year and have not experienced this before. I optimize my EA, on (15-17) assets every week and have been doing so since January. Last night, when I started my optimizations, the times were in the hours not minutes, checked the cloud agents and it was only
Hello Everyone ,, I need a little help I have calculations are shown on the chart but by a robot not as indicator , as comment , I want to make a comment on a blank indicator just to show my variables calculations with updated seconds interval, I tried but couldnt , Any help is appreciated, the
Im trying to make an EA as im learning to be able to place a trade on a 30s MA cross. I can make an EA that can trade based on MA crosses but the second time frame is super confusing. im a scalper so the 30s timeframe is great and i use tradingview, but i was wondering if there was a way to make an
Hi all, I am trying to optimize my EA with with different timeframes as input. Here is how I change the TF within the code, where Timeframe is the input: int OnInit (){ ChartSetSymbolPeriod ( 0 , NULL , Timeframe); ... Then in my code I simply use Timeframe wherever I need it (just in iCustom
Hi, I want to store a position ticket in result of stop order has been filled. I already store the order ticket when opening stop order and when the order is filled I want to update the stored ticket to a position ticket. If I loop all the position and find the position for that symbol and that
Hello everyone, I'm encountering a peculiar issue with adjusting my Stop Loss in a trailing manner and am hoping someone can shed some light on this for me. Below is the function I use for trailing the Stop Loss: void CPM::TrailingStopLoss( string pSymbol, ulong pMagic, int pTSLFixedPoints) {
Dear all, I am new to trading and am developing my first strategies in MQL5. Up to now, I am only testing different strategies in Strategy Tester. Whenever I open a position, I am essentially buying, I only "go long", because "going short" is still a bit nebulous in my mind. Imagine I start with
Hello friends Please I'm trying to make my gui buttons work on MT5 backtest Below is the code I used Please help. Thanks long lparam = 0 ; double dparam = 0.0; string sparam = ""; sparam = "btnLines"; if( bool( ObjectGetInteger( 0, sparam, OBJPROP_STATE ) ) ) OnChartEvent(
  Compile  (3)
I needed to compile a script first and then a robot I give you the coded script Automatic translation applied by moderator
Hello. How do you know there is a deal already executing on a position so you do not request another deal on that position? (I am running a partial close on a position and I do not want to run another) Thanks
Alain Verleyen once wrote in another thread that some brokers provide the wrong value. I think my broker is doing this. What should I do? Should I tell them or should I change my code to adapt to it? What happens is the EA calculates lot sizes for a position based on the tick value returned by
  Signal EA  (1)
Hello All people. I just now entered into creating robot. I want to ask all you guys for help. I want to make robot that I can send signal of Buy or Signal of Sell to all my copies of the robot which I give to people and all the people's robot must take the buy or sell which I send out. I was
Hello everyone. I do optimization based on real ticks. When it finishes I try running single tests and compare with results I see in optimization table. They are not the same. What could the problem be
Hello all, I get two different tick formats when using CustomTicksAdd and CustomTicksReplace with the same tick array input. The funcion CustomTicksAdd for some reason does not show the decimal point at the correct position in the tick history and Market watch in MT5. For example: FUNCTION <BID>
  Unresolved Static Variable?  (15   1 2)
Hi guys, can anybody explain, what that sudden error is supposed to mean? My EA was working flawlessly for months, but since the latest update, I get this error. In my EA I just declare an array CMoneyManagement mms[]; and CMoneymanagement has one static variable. Whats wrong with that...
Hello everyone, I'm currently developing a GUI using the CAppDialog class in MQL4. My application has the capability to save and load its state, including all GUI controls, to and from a binary file. I use the Save method provided by CAppDialog for this. The issue I'm facing is related to dynamic
if ( (MovingAverage1[ 0 ]>MovingAverage2[ 0 ]) && (MovingAverage1[ 1 ]<MovingAverage2[ 1 ]) ) if ( PositionsTotal ()== 0 ) { OrderSend (request,result); else if ( PositionsTotal ()== 1 ); CloseAllOrders(); }
Hi all, I am trying to optimize my EA with with different timeframes as input. Here is how I change the TF within the code, where Timeframe is the input: int OnInit (){ ChartSetSymbolPeriod ( 0 , NULL , Timeframe); ... Then in my code I simply use Timeframe wherever I need it (just in iCustom
Short Version Question - please help! : I cannot see (on scan) my LAN strategy testers (on my other computers) despite enabling network discovery and disabling firewalls. What else is there to try? My earlier, longer description: I can't believe I can't find a solution to this, so maybe I have
I am testing out iCustom with my own indicator which is a simple MA with arrow signals (long and short signals based on how the market price moves over the MA). This indicator is not to be used as an EA in live scenario as the indicator has no risk management features and it is not making exit
Hello everyone, I notice that when collecting historical trades from a broker with Metatrader 5 Backtesting, the speed of collection is very different if the collection dates are older or more recent: If the dates are old, the data collection is very fast and if they are more recent, it is very
Hello, Thank you in advance for ANY help I can get on this -- I'm not a newbie and this has me perplexed. I have a simple calculation I've always used to calculate dollars per pip (account funded in USD) and it has always worked on all forex and metal symbols at multiple other brokers. Now at a new
Hi, I have 2 problems that i can´t solve. I hope you guys can help me work it out. Problem 1: I have an EA that works fine on demo account. It places trades and the profitability is very good. I let it run all day on demo account and it works like it should. But when i switch to real/live account,...
  EA Buying Order  (3)
I have created a simple robot (EA) that executes an order which opens a position and then closes that particular position. After buying and closes the position the Journal shows an instant sell which I didn’t require. Please find below the Journal display, 2023.09.01 19:55:33.012 Experts expert
Hi, I have a stop order and want to save the new ticket after the stop order is filled. I tried to use OnTradeTransaction() class but failed to do so. Here's how I do it. void OnTradeTransaction ( const MqlTradeTransaction & trans, const MqlTradeRequest & request, const MqlTradeResult &
For some reason it doesnt update my trades with the new TP. Please help. double BAvgTP (){ double ask = NormalizeDouble ( SymbolInfoDouble ( _Symbol , SYMBOL_ASK ), _Digits ); double newbtp; double loss = 0.00 ; double Lsize = 0.00 ; for ( int i= PositionsTotal ()- 1 ;i>= 0 ;i--){
  Panel update  (2)
Hello i have ((account balance )) in my EA panel,But when open position the balance it does not really move with the balance unless I make an refresh manual,How do I make it move every tick with balance in the include file please. m_lMainAcc.Create( NULL , "lMainAcc" , 0 , 20 , 40 , 1 , 1 );
Hello i am experiencing a serious problem during automatic product validation testing, the robot is based on the US30_Spot and when running it in strategy tester , real account, demo account, no errors appear at all, not even warning and everything is operating perfectly when uploading the file and