Expert Advisors and Automated Trading - page 25

//+------------------------------------------------------------------+ //| OxygenTR.mq5 | //| Copyright 2025, Hüseyin Avni Ekmekçi | //| haekmekci@hotmail.com |
In OnTick(), if i want sell gold in $ 3230 , due to delays in broker,the next tick not find 3230 Position,repeated sell,i used Sleep(),but not much effect. Is there any other way
Hi everyone, I'm looking for a lot size that will be result in margin used equal to 1% of account balance across the different instruments I'm looking for a lot size calculation that will "normalise" any forex pair/commodity/crypto to use a margin equal to 1% of my account balance per trade (no stop
Hi there, does anybody have a remedy to this: Whenever an indicator is included via iCustom() or IndicatorCreate() in an Expert Advisor, and that Expert Advisor is then tested in the Strategy Tester (in visual mode), the included indicator also shows in the Strategy Tester . According to
I use SOA to distribute processed data . So, to make life easier i tried to use the ArraySetAsSeries() function for reverse access. For some reason ArraySetOfSeries() does not reverse my indexing order, I don't know if I'm doing something wrong or is it not supposed to work only with OnCalculate
I've been trying to calculate target price for a given profit value (in account currency) but I have failed! I've opened a position in USDJPY and with the following state: Volume: 0.01 Entry price: 152.982 Current price: 153.449 Current profit: $ 3.60 Now I'm trying to calculate the profit in MQL5
[Deleted]
I'm consistently receiving error 5273 when invoking SocketRead MQL5 API. I connect to the server from an MT terminal and would like to check periodically if some data have arrived from the server. Here is my code: if (client== INVALID_HANDLE ) return false ; uchar rbuf[ 512 ]; uint rlen=
Can someone please explain genetic optimization. I am reading Auto-tuning: ParameterGetRange and ParameterSetRange and my question is if this approach can be used with genetic optimization or only with "slow complete algorithm". The author has two input params FastOsMA and SlowOsMA and the rule is
Hi , but if i not have history , how can recover a commission of instruments ? thanks
Hello everyone When I use the iIchimoku function in MQL5 code, the Chikou Span value, which should be equal to the current candle's close price, is incorrect and returns a wrong value. Could you please guide me? Thank you
Hi, It suddenly appear that on my MT5 with a new adviser, after fast test, I got a list of optimization results, when I double click one of it, the result on backtest and graph doesn't match the profit result on optimization results. Here is the backtest result when double click above Pass:4 504
I am at a total loss of understanding. I read this thread: https://www.mql5.com/en/forum/326554 and tried using the news.mqh file and couldn't get it to draw lines properly, so then I have tried using Rene Balke's CalendarHistory.mqh file and it seems to correctly save all the values in a script but
Hi i have a and expert in ontick it call 2 function void OnTick () { CALC_DATA(); DrawLine4SnipeAll(); } void DrawLine4SnipeAll() { //Print("object_line4SniepAll: ", object_line4SniepAll); // Creazione della linea se non esiste if (g_dominance == "BUY" ) { if (
Hi All, If I run the onTick function to tell me CurrentTime, how can I filter the EA to do actions only when the time is :00 seconds? Thanks for the answers
How to copyright / protect your expert advisor for MT5? Which code should be added? Or when you want to copyright to a certain ip address or Name of User
Hi, I'm trying to test a strategy in MT5 created in SQ. In SQ, the strategy looks great, but in MT5, it doesn't execute any trades. The tester log shows the following message every time it apparently attempts to execute a trade: Any idea what the error could be? 01:10:43.129 Core 1 2024.02.16
  Neural network  (6)
Where can I learn neural network in mql5? Or which book can I use to learn neural network in mql5 or mql4
string TestROC_( int nPeriod, string cPair) { int i; int sizeOfnResultROC = nPeriod; double nResultROC[]; double nResultClose; double nResult; double nResultAbs; double nResultA; double nResultB; int nRow = 2 ; int nCol = 3 ; ArrayResize
I’ve recently started programming and I’ve encountered a small issue. I’m using MetaEditor through my broker’s terminal (Puprime). After compiling the file and sending it to someone using a different broker, they receive an error message stating that a newer version is required. Does this mean I
my source: if (condition1) { operator1; } else if (condition2) { operator2; } else if (condition3) { operator3; } //but metaeditor " catl+," format this: if (condition1) { operator1; } else if (condition2) { operator2; } else if (condition3) { operator3; } my condition1,2,3 are same
  Closing a trade.  (1)
Good day. Say someone asks me to "Modify their trade closing by Including a delay to function A" Function A closes trades when an indicstor gets a particular setup. When modification is done as per specific requirements. How ever clients main problem wasnt what they asked for. But it is that
I am coding an EA for trading SAR. My bear positions, based on the SAR, never action. All bull positions work fine. Using counters for each function I have confirmed that every function works as required. values. in the below code simply refers to a pre-made structure. void OnTick () {
How to write iCCOnArray for RSI in mql5
  What is wrong?  (2)
string cciOnRsi_ ( int nPeriod, string cPair) { double rsi[]; double cci[]; ArrayResize (rsi, Bars ); ArraySetAsSeries (rsi, true ); for ( int i= Bars ; i>= 0 ; i--) { rsi[i]= iRSI (cPair,nTimeFrame1,Period_EA, PRICE_CLOSE ,i); } double cci[i] = iCCIOnArray(rsi, 0 ,Period_EA, 0 );
I am writing to report a persistent issue I am experiencing when compiling MQL5 code in MetaEditor. Problem Description: When compiling code that calls the symbolInfo.VolumeStep() method from the CSymbolInfo class (included via <Trade/SymbolInfo.mqh> ), I consistently receive the errors 'VolumeStep'
How to write this mql4 code to mql5: string TestCCIonRSI( int nPeriod, string cPair) { int sizeOfaNizDan = nPeriod; double aNizDan[]; int i; double nResult; int nRow = 2 ; int nCol = 3 ; ArrayResize (aNizDan,sizeOfaNizDan); ArraySetAsSeries (aNizDan, true ); for (i =
Dear all, After many months of back-testing with Expert Advisors (EAs) I wrote myself in MT5, I decided to dive into live trading. But, for about a week now I am stuck. I log in to my live account, open the chart of the instrument I want to trade, drag my EA to chart, I enable algo trading both in
Hi i am newbie in programming. i want to develop simple EA that trade once every trend confirmation, but in my code the EA open the trade in every bar after trend confirmation. if (trend[ 0 ] == - 1 ) // -1 means sell { obj_Trade.Sell(LotSize, _Symbol ,bid,bid+StopLoss* _Point , bid-TakeProfit*
  What is wrong?  (1)
for the ParSar: double GetSARValue( string cPair, int nPeriod, int bar) { double sar[ 1 ]; int sarHandle = iSAR (cPair,nTimeFrame1,Step,Maximum, 0 ); if (sarHandle!= INVALID_HANDLE ) { CopyBuffer (sarHandle, 0 ,bar, 1 ,sar); } return (sar[ 0 ]); }
I am learning how to code in mql5, I am trying to make an EA but can't be able to get the correct indicator values for each candlestick, I hope some experienced programmer can help