Expert Advisors and Automated Trading - page 213

To post a new topic, please log in or register
im trying a basic stochastic EA which works great until it doesn't. I've put just a stop loss in the input variables clicked Ok but the stop loss doesn't show when back testing. anything silly I've missed?
I want obtain current price of the market... It's just tick. And how know if the Japanese candlestick is end. All this with mql5, Thanks a lot.
I am french and new in mql5. I juste want put bollinger band with rsi and get cross with mql5. i want use : -bollinger period 10 and deviation 1.5 - rsi 7 I don't know how to put bollinger with rsi in mql5. Thanks.
Hello, find below a smal ea which demonstrates the problem: When using CopyOpen and CopyClose, values of open and close of last index (highest) always identical. int minbarcount=10;int lastbarcount=0;int OnInit(){ return(0);}void OnDeinit(const int reason){}void OnTick(){ if...
Hi there ! Please excuse my ignorance as I am trying to migrate to MT5. I downloaded Include, Indicator and Expert files from this page: https://www.mql5.com/en/code/1190. The "Include" files I saved to this folder: C:\Program Files\MetaTrader 5 - Alpari UK\MQL5\Include The "Indicator" file I...
hi I'm back testing a moving average Cross over and for three quarters of the backtest its really profitable but then in the last quarter it suddenly sells when it should buy and vice versa. How can it do this ?
  backtesting EA's (11   1 2)
Hello I'm new to MT5 and never used automated trading before. I'm quite intriged by the potential and decided to makae the leap. I've imported quite a few EA's but when I watch them perform in the Strategy Tester Window they never buy or sell at the right times.Has anyone encountered something...
I selected M5 as the time frame to execute my EA. Strategy Tester opened the M5 chart, but the candles in the chart are daily. I held my cursor over three consecutive candles so you could see the info
When I am writing the code for an expert advisor, how do I apply an indicator on the data generated by another indicator? for example, putting bollinger bands on RSI. because in the iBands functions, you need to put the symbol name. Any help is greatly appreciated.
Hello, I Have times a EA code "found" and thought him easy to convert. Similarly Martingail (excluding hedge). Of the original IS hardly remained. My code makes what he wants. And driving me nuts. Do I think about it logically correct have made​​, But probably not structural WILL die cast...
  draw arrows in EA (17   1 2)
I want to try to count wave patterns in my EA and see the wave counts on the chart. Do I need to create a custom indicator and attach that indicator to the template file and access the custom indicator in the EA or can I call a function to draw an object on the charts directly from the EA? I have...
  EA template (16   1 2)
When I test my EA in different time frames, the chart that is produced does not have the same set of indicators. I have a template created that has MACD, Bollinger Bands and moving averages. When I run my EA in M5 or H1 time frame, only the indicators I have in my template are displayed. When I...
Hi all,  After a lot of reading, I think I'm ready to post my first message. Which contains a probably easy question but I can't seem to be able to solve it, and after several hours of searching I decided to shoot it out here :)  Anyhow, I'm trying to make an EA that stores yesterdays range , goes...
Hi, I need to write a function that returns 2 file handles, which are just ints, so I thought to declare the function like int[] getFileHandles(); but MT5 didn't support returning an anonymous sized array, and wouldn't let me return a pointer to it or even to specify the size like int*...
I have a doubt about how an stop loss order is implemented. Example: Imagine I have a Stop Loss sell order on EURUSD at 1.32045 (well below the current market). The market reaches 1.32045, the order fires, but without time to complete the full quantity, the market jumps to 1.32050, and stays there....
I have been coding for quite some time, but today I learned something new. For all of the experienced programmers out there, this maybe pretty obvious, but for anyone just learning, please read. When calling an indicator within an EA like this example, you assign a handle of type int:...
Hi, I got some troubles calculating the StopLevel - here is my code: double currPrice = SymbolInfoDouble(_Symbol,SYMBOL_ASK); double point = SymbolInfoDouble(_Symbol,SYMBOL_POINT); double stopLevel = SymbolInfoInteger(_Symbol,SYMBOL_TRADE_STOPS_LEVEL) * point; double stopPrice = currPrice +...
I tested my EA at a friends pc and the global variables show up fine. But at my PC it only returns 0. same ea. same set. same time. Also they shop up at my pc in demo or real mode. they only dont show up in strategy tester mode anyone has an idea?
When I add AutoDayFibs (2).MQL4 Source file in indicator folder the meta trader software will be hang... I can use win7 sys. Pls give solution on this error...
  Automated Testing (16   1 2)
Is it possible to call the tester for optimization from the EA? What I want to do is re-optimize every weekend after the market has closed. I can use MqlDateTime str1; TimeToStruct(TimeLocal(),str1);if (!selfoptimize) return;if (str1.day_of_week!=selfoptimizeday) return; to check for the...
Hi everyone, So I am in the process of creating an automated trading program and would really love to get your input. This is where I began trading and so I thought I would get the opinion of the mql5 community first. It is just a short 8 question survey to help me get started. I would really...
Need know when a deal is done, if: (1) it created/scaled in, or (2) closed/scaled out, or (3) reversed position. As I understand it DEAL_ENTRY_IN would indicate if (1); DEAL_ENTRY_OUT would indicate if (2); and DEAL_ENTRY_INOUT if (3). However, no matter if I open a position, close, scale, or...
Hi all. Is it possible to detect automatically (script) the switch period between winter/summertime in America when i'm located in Europe? In the United States, Summer Time begins on the second Sunday inMarch and reverts to standard time on the first Sunday in November. In the European...
i have write the code like this : void OnTick() { // some codes... if(!PositionSelect(_Symbol)) { CTrade trade; trade.PositionOpen(_Symbol,ORDER_TYPE_BUY,0.1, SymbolInfoDouble(_Symbol,SYMBOL_ASK),...
Hello, on MQL4 it was very easy to get the value of Bollinger Bands double Upper = iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_UPPER,1); double Middle =iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,1); double Lower = iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_LOWER,1); hot is the same on MQL5...
I'd like to protect my Code both when showing it to someone and when sharing the strategy with someone. Is there any way to do this? Also, the metatrader language has to be a psuedo-language. Is there any way to see the underlying C# code? At least I think it must be C#. I've also been able to...
Tried to building EA based on recommended usage of the most commons indicators such as ac, ad, adx, even combination of ma and par RESULT with the setting of equal pips to win and larger pips to accomodate the possibility that favours the movement(prevent early stop loss) with the recommended...
extern double MaxSpread = 3;int start()  { int SellOrder = 0; if(MarketInfo("GBPUSD",MODE_SPREAD) < MaxSpread)      { SellOrder = OrderSend ("GBPUSD",OP_SELL,1.0,MarketInfo("GBPUSD",MODE_BID),5,0,0,""...
Hello, Have a position for Symbol x and need to know the closes StopLevel that would be accepted by trade server. How to do this ? Thank you
I want my EA to close trade based on the change,lets say drop in bar of an indicator compared to the previous one. how can i set the condition? and if there is a manual can anyone link me? confused here