Expert Advisors and Automated Trading - page 224

Hello, I wrote a simple bot with MQL5. It only has 2 input parameters (SL and TP distance) When I run strategy tester I get no results. It just shows as if it's working forever. Any other bot I'm testing has no problems. Do I need to do something special for my bot to work with strategy testing
Hi, I have problems getting indicator values within the OnInit() function. Same methods have no issue in OnTick() function. Below is a demo of the issue. The following is the code used. //+------------------------------------------------------------------+ //|
I'm looking for a framework to slot in my own trading strategy. What is the best one? Framework to provide such features as: Order entry Trailing stop options Spread options Order management Equity curve display Multiple Symbols Trade Management All options exposed as parameters so they may be
I want to create an EA with simple buy and sell stop order, the problem is I want to constantly placing a pending order (buy/sell stop depending on the first executed pending order) every time an order is place with a condition of deleting all positions and orders if take profit or stop loss had
[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=
Just curious if there a neat way of closing order without using CTrade in trade.mqh file in MT5.  Just miss simple standalone "OrderClose" function in MT4.
#include<Trade\Trade.mqh> // create an instance of CTrade CTrade trade; input int SmallMovingAverage= 10 ; input int BigMovingAverage= 25 ; void OnTick () { // we calculate the ask price double Ask= NormalizeDouble ( SymbolInfoDouble ( _Symbol , SYMBOL_ASK ), _Digits
Hi, I have read https://www.metatrader5.com/en/automated-trading/strategy-tester and https://www.metatrader5.com/en/terminal/help/algotrading/testing#forward But I still don't understand what is actually going on here... nor can I find a proper answer anywhere else thus far! What is actually going
Hello, I have a problem on Metatrader the macd is different from another platform i use trading view and its messing up my ea
Hi everyone I am writing an MT5 multi-currency EA that uses several indicators. Rather than create Handles and Arrays for each Indicator/Currency I created functions to easily get the values for each indicator that I use in the OnTick on every new candle. It takes however rather long to calculate
Where can someone get more info about grid in EAs? More specifically how does the take profit work in grid
Hi everyone, when I try to access the prices of another symbol when using the "Open prices only" mode, I recognize a delay of one bar. I made this simple EA to show the effect //+------------------------------------------------------------------+ //| Expert tick function
Hi, I am currently finding couple of things which don´t seem to work proper in tester, but which surely should. 1. ObjectSetInteger(chartid, name,OBJPROP_ALIGN,ALIGN_CENTER)); - has no effect in tester, all edit fields have left alignment 2. ObjectSetString(chartid,name,OBJPROP_TOOLTIP,"Tooltip"); -
Hi everyone. I want to ask you if it's possible for my EA to perform really well from March 2020 until now, and when I proceed to test it out in 2019, it basically doesn't perform even close to that. Risking 3% per trade in 2020, you would get ~15-20%, and in 2019 it would loose money actually. Is
  Tool to Trade  (1)
Hello, I am looking for a tool that can place trades according to the % of the account, have lines shown to trade by the ratio (i.e. 2:1) and other features. I have a example of what I am for. Please let me know if you have this tool to sell. Thanks
Hello, I cannot change data in the Inputs when I try to test any AE.  After the change, it goes back to defaults. Can you advise what can be wrong? Thanks
How do i create an Array to store the "NewCalculatedValue" values and access those values when needed ? since the handle is an integer. The New value is Calculated value on every tick and only checked at the Open of every candle ( e.g M15 ) #include <Expert/Expert.mqh> #include
hi iam using robot for trading i would like to know the the trade size mathematic formula to hold a position down to 40 pip loss for usdjpy stop out 50% leverage 500 i thinks its like that i have calculate this 40 pip of loss=400$ for usdjpy for a balance of 600$ leverage 500 stop out 50% so i
Hi, I'm new with building trading systems and started to implement a basic buy/sell martingale system. All goes well with the back testing, when in 9th March 2020 (covid19 panic, i guess), I found this pattern. Any of you knows how I can detect and avoid this kind of market trend? The price
Is there any EA, where I can select fixed loss per instrument, and it will close all position on that instrument when total loss gets to preselect amount? For instance: EA attached to WTI and parameter set to total loss 500 USD, 1st position is open, goes in loss 100 USD, than 2nd position is open
Hello I lost my one activation on all my EAs when I got windows update on Sep 18, 2020 Please can you give me back one activation on these EAs. <Deleted> Thank You
  EA coding or KEY  (3)
hell guys say i created an EA how can i have it password protected or coded or keyed
Hi. I am having problems writing code using Meta editor. The frame suggests when the code is partially missing. Hints are not found. My monitor is at 1920x1080 resolution. Thanks :) MT5 keeps getting better and better
Hello, i like commissions to be respected in backtest and it seems settings you can do when clicking "emulate slippage..." on backtesting settings have no impact. In order to test, i created an own commission row for the instrument of backtest. GBPUSD. Then i set the commission to 0. (Where
I recently formatted my computer and lost a script code that did this function . I tried to recreate it but was unsuccessful. it was like this datetime now = TimeCurrent (); datetime nowTF = now - now % ( 60 * time[ 0 ]); datetime period = iBarShift ( NULL , 0 , nowTF); datetime openprice = iOpen (
Hey guys I am curious to see what people have to say. If the overall trend of a market is clearly sideways. Will a trend following ea work or fail in that type of market if we are stickily trading the 1 hour time frame ? Any thoughts and opinions would be great
This code always returns zero for commissions void OnTradeTransaction ( const MqlTradeTransaction & trans, const MqlTradeRequest & request, const MqlTradeResult & result) { if (trans.symbol == Symbol ()) { if (( int )
Hi, is there an equivalent for Open[], High[], .. Volume[] of MQL4 in MQL5? Actually I am using Volume[i] in OnInit for a volume-indicator in a separate chart-window to set the max. and min. int OnInit() {    ...    while(b-->0) {       lMin = fmin(lMin,Volume[b]);       lMax = fmax(lMax...
double dailyPriceInfo[ 4 ]; void OnTick () { daily_price_info(dailyPriceInfo); Comment ( "Daily High " , dailyPriceInfo[ 0 ], "\n" , "Daily Low " , dailyPriceInfo[ 1 ], "\n" , "Daily Range
I notice that even after backtesting the same instruments frequently, MT5 seems to spend a lot of time downloading data. Does MT5 download the same data with each test? This wouldn't seem to be very inefficient