Expert Advisors and Automated Trading - page 25

Hello, I've Googled extensively for this answer, but can't find it! I've just setup a signal, and obviously the initial lot sizes are based off the % set of the initial deposit, but is this always the case? Ie, the lots don't get bigger as profits are made? It clearly says "use no more than x % of
{ m_trade.PositionModify( _Symbol ,sl,tp); Print ( "ch slb sl=" ,sl, " tp=" ,tp); } // Normalised like: double tp=NormalizeDouble(m_position.TakeProfit(),Digits()); This is inside an EA working with cfd
//CAN SOMEONE ASSIST ME TO SOLVE THIS ORDERSEND WRONG PARAMETERS COUNT// #include <Trade/Trade.mqh> // include Trade library for OrderSend function #define OP_BUY 0 #define Ask SymbolInfoDouble ( NULL , SYMBOL_ASK ) input double TradeSize = 1.0 ; // input parameter for trade size input double
I was testing the ENUM_SYMBOL_CALC_MODE enumeration with the TradeCalcMode () function of the CSymbolInfo class ... I tried EURUSD and USDJPY. I was expecting that (TradeCalcMode() == SYMBOL_CALC_MODE_FOREX) Becouse (Leverage()==200) But however (TradeCalcMode() ==
Hello everyone. I have a problem that is really driving me crazy. I don't understand why the if of the while is not activated. I already checked (with the prints) that the values are valid enough to enter, but it doesn't happen and the while continues executing skipping the if. Can someone explain
input int Magic = 113 CTrade trade; int OnInit () { trade.SetExpertMagicNumber(Magic); return ( INIT_SUCCEEDED ); }
Dear MQL5 community, I am using the MQL5 calender function directly from the Metatrader platform and I have the following issue: Currently, I am using this specific code to get the required calender events ( The variable "EU_code" is an input variable and can be "WW", "EU", "US", "JP" etc. )
  Expiry code  (3)
Hello, I want to add a expiration code to my MQL4 EA. The EA trades on indicator basis. Whenever the indicator prints a signal, at the candle closure it will place the trade if the 2nd condition is met (price needs to be above the green line for a sell, and below the green line for a buy). However
  RangeBreakout EA  (6)
Hi All, I have this code which trades breakouts. Id like to reverse it so it buys on the low and sells on the high. Thanks in advance #define VERSION "1.0" #property version VERSION #define PROJECT_NAME MQLInfoString ( MQL_PROGRAM_NAME ) #include <Trade/Trade.mqh> input double Lots = 0.1 ; input
the strange thing is, the expert just did well in testing, it was able to trade in tester without problem. now no matter what I do, it pops a  [trade disabled] error each time EA tries to open a position. trade disabled in tester ??? how ? and why it happens suddenly, without changing anything ?...
Hello, I am trying to use extern instead of Input because i am changing it value later on the code. I am getting an error : extern variable initialization is not allowed
Hello, I'm reading about encoding strings in this https://docs.mql4.com/common/cryptdecode but the problem is, how can I decode it in another language like C#? It seems ChatGPT can't help me
Hi, do you use any tests when push new commit on git? How can I run strategy tester in git and for example check if my algo failed (i have an pointer which i could check) ? my algo gets bigger and it is annoying even do some smoke test. regards szaqual
Hello everyone. I am doing backtesting which takes into account previous and current day's lows and highs. I downloaded the ticks from QuantDataManager but they are utc, and the broker I want to trade on is gmt+3 (icmarket). How can I solve this? Thank you very much
I'm trying to get the Day profit for the current symbol and magic number using this code but getting a "HistoryDealGetInteger" no one of the overloads can be applied to the function call error. What does that mean? How do I fix it? Thanks double DayProfit() { double dayprof = 0.0 ; datetime end
Possible to copy a trading account Signal off of mql5 while running my own EA(s) on same MT5 platform? It'll be on mql5 VPS
Hi All, I am try to build an EA on MQL 5 and have been trying to accomplish setting up an stochastic indicator and an exponential moving average indicator to inform my EA on the strategy to follow. When I add the two indicators on meta editor on the same editor window it looks as follow, I am trying
I have created some functions to run ONLY when I CLOSE any POSITION and to achieve this i am using this function. void OnTradeTransaction ( const MqlTradeTransaction & trans, const MqlTradeRequest & request, const MqlTradeResult & result) { Print ( "type is:" , trans.type); if (trans.type ==
Hi, Tensorflow recently announced that going forward with TF 2.11+ they won't include native GPU support in their windows versions anymore. TF 2.10 was the last version that allowed running TF with GPU on Windows. From TF 2.11 on, Windows users need to use WSL2, for example in Visual Studio Code or
Hello everyone. I am trying to create a SpinEdit in my EA code. Although it is shown on the chart but seems like it is disabled and the value cannot be changed. Thanks for your help. #include <Controls\SpinEdit.mqh> CSpinEdit m_spin_edit; int OnInit ( void ) { m_spin_edit.Create( ChartID ()
#define ExpiredErr "Please contact the seller, this version has expired. " #define ExpiredErrr "Wrong symbol " int OnInit () { //--- Enable Trail datetime expire_date = D'2024.04.01' ; if ( TimeCurrent () >= expire_date ) { Comment (ExpiredErr); Alert (ExpiredErr); return ( INIT_FAILED );}
Hi all, could you suggest a method to detect if previous bar is Sunday? Thank you
  What are my options ?  (16   1 2)
When a Developer wants to cancel a job and steal my intellectual property rather than fix HIS problem For whatever reason I am unable to optimise the TF and he cannot fix the problem in HIS code Shows me HIS results and expects me to pay in full for an unfinished job Not the best of copies
I downloaded the tickstory data for EURUSD for 2023 and made a custom symbol. My algorithm is set to enter a trade when there is a one pip spread. With the custom symbol, the algorithm enters 500 trades. When I use my broker's data for EURUSD for 2023 and make no other changes, the algorithm doesn't
the EA is based on indicator using chart Objects "Bheuresko Pattern"
My agents working time is not going forward... I noticed this since the last update (few days ago) They have many jobs... This job for example (One hour x 28 Threads). CS 0 02 : 15 : 57.181 Tester job 7345665837451199872 received from Cloud Server CS 0 02 : 15 : 57.181
When running CopyTicks ( Symbol (), ticks_array, COPY_TICKS_ALL , 0 , 2000 ); from the OnTick() function of a EA the return value is 0 and no ticks are returned even when the function is retried 3 times when no data is returned. The symbol is EURUSD. ticks_array is a dynamic array but it is
import MetaTrader5 as mt5 

 # display data on the MetaTrader 5 package 
print( "MetaTrader5 package author: " , mt5.__author__)
 print( "MetaTrader5 package version: " , mt5.__version__)

 # establish connection to the MetaTrader 5 terminal 
 if not mt5.initialize(path= "C:\\Program Files\\FTMO
Hi there, i'm copying a signal here on MQL5, running on a VPS. Its been running nice over 1month but on Thursday i lost 40% of my account and i want to understand why, as the source made a nice profit on that day. What was different than normally, is that alot of trades happened, but no new symbols
  Optimise TF  (2)
My EA will not optimise the TF ... any suggestions