Expert Advisors and Automated Trading - page 10

#include <Trade\Trade.mqh> //Instatiate Trades Execution Library CTrade trade; // Trades Info and Executions library void OnTick () { double Ask = NormalizeDouble ( SymbolInfoDouble ( Symbol (), SYMBOL_ASK ), _Digits );
Dear All I am trying to create Multi Symbol EA using OOP. I have created a set of files and EATemplate to test it. I am getting invalid pointer error in the mfCStrategyA (child of mfCStrategyBase). To my understanding child class should be able to access variables/methods of parent class, which I am
  ExpertMAPSARSizeOptimized  (13   1 2)
Hi, does any artical talk about MT5 build in EA Sample ExpertMAPSARSizeOptimized? It is wriiten in pure OO style, but metaeditor is not excellent enough as Eclips or VS studio now. Sometimes i feel reading MQ5 OO program using metaeditor is just like using Notepad. :) I cant get the point of the...
I'm having issues validating an update to an EA, and I can't figure out what I'm doing wrong. The problem is with the trailing stop, and even though I validate the SYMBOL_TRADE_FREEZE_LEVEL and SYMBOL_TRADE_STOPS_LEVEL, I still get the error "[Modification failed due to order or position being close
Hello everyone. Suppose you need to create an EA to close all trades and disable autotrading once it hits a minimum daily profit target. As you know you cannot be sure to close all trades exactly at the price you desire besides the deal out commission that is not predictable sometimes. This causes
Good Day, Please assist I have coded the two horizontal lines in between the Bid and Ask price line. I need the lines to move as the bid/ask price lines move. I tried the Objectmove() function and they only move when i recompile the file. Please assist how or what code I can use to solve the
  Range Breakout EA MT5 issues  (11   1 2)
I wrote that code by some youtube programming channel. No errors, compiles fine but in tester DrawingObjects doesn't look right(specially range) and finally it stops taking trades(probably because of that buggy range) //+------------------------------------------------------------------+ //|
Dear Good day I am learning to code EA for two timeframe EMA trading strategy . I need to count/calculate the number of bars from when FAST EMA crosses SLOW EMA and when the Ask Prices retraces back and touches on or below SLOW EMA. I need to record this number as well as be able to get the
#include <Trade\Trade.mqh> CTrade trade; I am new to mql. I have seen the code above in *** but there are parts I do not understand. I understand the first line. We are importing the Trade header file from the Trade.mqh library. What does the second line mean? Are we assigning the CTrade class to a
I recently raised the following issue , where I was having problems using input variables in a common file (MT5 V5.00 build 4150). I eventually got to the bottom of the issue and believe that I have found a bug with input group when used with iCustom(). The input data is shown here... enum LogLevel
Hi I have created a VWMA custom indicator , and using an OOP class to get VWMA_Tx (triple period values) for different timeframes. The class is however returning _Sybmol + _Period data only, irrespective of initializing class with different time frames. Please help me out, what is wrong in my code
Hello First ever post, and total novice in mql5. i am coding a practice EA to learn the language and platform. I have placed the trade.buy after checking if any open postions, despite this conditional check the ea seems to just keep placing more orders. Another weird thing that is happening is a few
Hello. I'm new to using the OnTradeTransaction Event. I'm using it to detect pending orders that I place manually from a different terminal. The pending orders should trigger the EA to start a trading session based on the pending order parameters. That's working very well. But now I want to delete
Hello, Please see the attached as I am trying to add my EA to market for sale but getting the attached error. EA runs perfectly when back testing. Thanks
int bandsHandle = iBands ( _Symbol , PERIOD_CURRENT , BB_Period, BB_Deviation, 0 , PRICE_CLOSE ); double bbUpper[]; double bbMiddle[]; double bbLower[]; CopyBuffer (bandsHandle, 0 , 0 , 1 , bbUpper); CopyBuffer
Example: Initial range (pips) = 50 pips. Multi range between orders = 2 . 1st buy trade 0.1 lot; 2nd buy trade 0.2 lot opened below 50 pips on a new candle open. The indicators are still aligned ; 3rd buy trade 0.4 lot opened below 100 pips on a new candle open. The indicators are still aligned ;
i'd like to code EA which has a 2 step signal , if something happens ( like a cross ma or anything ) , then wait for 1-5 candles to see if another behavior happens and only then give me the signal the problem i'm facing is that after the first check , i don't know how to keep the value static for 5
Is there a programagic way (like SymbolInfoDouble, or AccountInfoDouble) to get the broker's commission per lot. From the market watch window, I can get it by right click on a symbol -> symbol specs. Anybody has an idea how the market watch window implemented it? I suggest this feature should be
Hey dear, I have been looking for something to reduce the lot of an pending order. Let's say I put the a 10 lot buy limit. Later on I want to reduced it to a 5 lot buy limit, before it got open. It's there a function to do so
Hi all I have a short simple code here below, if anyone could help please , it would be really appreciated. Main idea is when the fast ema cross over slow ema then to open a buy position and actually it works quite well with the code below. However I need your help about how to close the position
Hello, champs! Tried to search around and couldn't find a proper solution. I'm trying to create an EA that detects pending orders I place from my mobile terminal. It will extract some information from the order and close it. It will instead remember the details, and calculate new entries and exits
Hello, When backetsting an EA on strategy tester on MT4, will the value you use on strategy tester be the exact same as when configuring the bot for live trading? Or is one pips and the other points? If I use 3250 points/ pips as TP on strategy tester, will I use the exact same 3250 as the TP under
Free to write MT4 EA program, I want to practice, EA programming and learn excellent trading strategies, if you want to program can find me The following pictures are some of the EA I programmed and the results are not so bad
I have a piece of code that calls into the canvas CreateBitmapLabel() method... #include <Canvas/Canvas.mqh> CCanvas canvas; canvas.CreateBitmapLabel( "test_name" , 0 , 0 , width, height, clrfmt); This in turn makes its way down to the Create() method... bool CCanvas::Create( const string name
  Don't load ea  (3)
I am having these these as shown in the photo . Please help us to install EA
Hello. I have on my onInit many return(INIT_PARAMETERS_INCORRECT); statements to exclude any combination that doesn't make sense and save passes. That still leaves tens of thousands of possible passes if not more. However the genetic based algorithm only runs 512 passes out of which most are with
Hello friends! I am building a NextJS project to improve my full stack skills and am wanting to know how to get trade/account history to display on a dashboard? Much like MyFXBook and FXBlue do it! How do they do it? haha I know MYFXBOOK must use some kind of api as you can enter a username and
Hi, I wanted to test my strategy on stock and had to changed the demo account, using VantageFX-demo account. Had to switch the filling_type to SYMBOL_ORDER_MARKET and then I got the " Market closed " error on order execution. With other order types is got "unsupported filling type". I can't seem to
Does anyone know how I can know how many lots I can open for example in a buy knowing the available capital? double max_lots() { double lots = MathMin (( AccountInfoDouble ( ACCOUNT_BALANCE )* AccountInfoInteger ( ACCOUNT_LEVERAGE )/ SymbolInfoDouble ( Symbol (), SYMBOL_TRADE_CONTRACT_SIZE ))