Expert Advisors and Automated Trading - page 220

To post a new topic, please log in or register
Hello, i thought that strategy tester automatically loads data from server which are needed for backest and stores those data locally and permanently (so new download of same data not required). This seems not to be the case. When do a backttest for EURUSD 5 Minutes from 2005 to today, i get data...
Hi everyone, I just modified my first EA from a tutorial. Everything went smoothly, it compiled with no errors, and it places trades! (yay!) However the STP and TKP values are never triggered in the strategy tester (which means that all trades are closed at the end of the experiment). I've looked...
  question (1)
In an expert adviser, in the OnTick() function, is there a way to set a global variable that will retain its value it had during the previous call? I'm looking for a variable that won't re-initialize with each new tick.
Hi guys, I'm just wondering if there is a function to get the position opening time here in MQL5? I've read the various trade functions and the data structures but can't seem to locate this function. I'm intending to close a position based on a fixed time after being opened if the takeprofit and...
I'm just wondering if there is any difference between the two lines of code below.... (for calculating the spread) 1: double Spread_1=NormalizeDouble(SymbolInfoDouble(Symbol(),SYMBOL_ASK) - SymbolInfoDouble(Symbol(),SYMBOL_BID),_Digits); _______________ 2: MqlTick current_price; double...
I've been encountering problems with backtesting in the metatrader 5 platform specifically entering Stoploss and take profit levels similar to the problems raised by some members before: https://www.mql5.com/en/forum/7012 I'm currently using Alpari's MT5 platform and couldn't backtest properly...
Like in the topic - does anyone know? Unfurtunately CList and CArrayObj from the standard library don't allow struct type.
Hello MetaQuotes, Just came up with a suggestion - could you consider ehancing the OnTrade() event handler? The solution that I propose is having OnTrade(ENUM_TRADE_EVENT_TYPE &event_type), which would allow MQL5 programmers to handle particular trade events (e.g. stop loss/take profit...
I've read the documentation, and looked at some examples of code, but still not sure what this guy does. Help! Is it the same as _Digits?
Hello, how to obtain datetime from currently simulated bar when backtesting EA. Thank you 
Function OnTest allows to retrieve some results from backtest by calling function TesterStatistics. I miss some properties, like: a) start -and end date (custom period) b) optimization c) simulation (tick, OHCL,etc..) d) execution Anyone knows how to get this programmatically ? Thank...
Dear all, I have difficulty to write this martingale function from MQL4 to MQL5. Please help me to convert this script to MQL5. double Calculate_Lots(){   double lots=Lots;   double MinLots=NormalizeDouble(MarketInfo(Symbol(),MODE_MINLOT),2);   double MaxLots=NormalizeDouble(MarketInfo(Symbol()...
I am looking for a developer to create a customized Expert Trader that I can utilize while not at my desk. It is based on the convergence/divergence of two MA levels, while having the ability to buy/sell in various increments using a couple of indicators as support. I would also like the ability for...
Hi guys, I've been exploring the strategy tester and playing with some EAs in the article and code base sections. When I backtest an EA for the first time and change the parameters for the second backtesting (e.g. stoploss,takeprofit,etc) the outcome does not change. Here's the screenshot of the...
I'm just confused, it appears to me that both CTrade and MqlTradeRequest can be used to place a trade independently. Is this true? And if so, is one better that the other?
Hello all, I have a problem with using hidden TP and SL in mql5. How to write it ? Many thank for your help.
Hi all, I don't succeed in placing a buy stop order... When using a MqlTradeRequest and OrderSend(), what information do I need to enter?? What are stoplimit and price representing in the case of a buy stop order? Thx, struct MqlTradeRequest  { ENUM_TRADE_REQUEST_ACTIONS action;...
When I backtest this EA run properly but when I attach EA to chart for demo account, in Expert Tab display message "cannot load indicator 'MACD' [4302]". What's it mean? And what's wrong?
Hi all guys I need an EA to monitor another EA that are working on an account. I need a code in meta trader to log when a position is opened/closed or changed TP/SL. May I ask you to help :) Thanks
Hi,   I want to write data to a CSV file for analyzing. It writes effectively but only one valye, and not each value at each tick or bar. There is something i don't understand. Anyone can help me?   Here is my code, copied and adapted from mql5 reference. The write code is in a function, called in...
Hello, have problem with writing file from within OnTest string terminal_data_path=TerminalInfoString(TERMINAL_DATA_PATH); string filename=terminal_data_path+"\\MQL5\\Files\\"+"mytest.csv";     int filehandle=FileOpen(filename,FILE_WRITE|FILE_CSV);...
Hi! From what I understand, the take profit is use to automatic close the deal when the price reach to the take profit price. but during strategy testing the deal is not close even the price is raise over x times of the take profit price. All my deal was closed at the end of the strategy testing....
Hellow guys I notice some huge differences in the test tick data in different terminals for example in Meta Quotes(ATC 2012 Account) and Alpari Demo Server. In Alpari Terminal i have lot more ticks over 1,8 million for the last month and in Meta Quotes over 800 000 in the same period. Both shows...
  EA Parameters (2)
As long as I know, EA parameters usually for setting up take profit and stop loss. Can EA parameters set the hour for place an order?
Hi, I am learning and writing my first Wizard Signal module and have trading signal depending on position type. Is it necessary to create object to excess PositionType() within LongCondition() code part? CPositionInfo m_position; m_position.PositionType() Or can I access it via pointer...
Dear Experts, I encounter the issue that the Lines are drawn into the "first Window" but not into the Window where I want them to be seen... So: I´m doing this for PERIOD_15, PERIOD_H1...: //SNAP .....    if(CopyRates(_Symbol,PERIOD_M15,0,500,rates_M15)<0)     ...
I have an indicator that uses an onTick () event for one currency pair. I am trying to use that indicator on one currency pair that use on onTick event to trigger a trade for another currency pair. Does the onTick event work in an EA attached to a different currency pair?
  Backtesting Multi-Currency EA (35   1 2 3 4)
I'm currently backtesting a multi-currency-pair EA in the MT5 Strategy Tester and I get different results when attaching it to different currency pairs. The EA trades on AUDUSD and GBPCHF. When I attach it to AUDUSD it gets 10k profit. When I attach it to GBPCHF it gets more than 30k profit. When...
Hi, I'm a programmer new to MQL and to this forum. Right now I'm trying to trigger the NewTick event for an Expert Advisor attached to a chart on "open prices only" mode --which ticks for every new period for the chosen time-frame (M1, M5, M15, ...)-- so I can make use of the OnTick() function to...
Hello, i like to code an expert advisor based on indicators and want thess indicators also drawn into chart. Is this possible ? My tests shown that this seems only be possible when running strategy tester using iMA, for instance. But when attaching ExpertAdvisor to chart, no line is drawn even...