Expert Advisors and Automated Trading - page 111

Hi, I am going to do following: I want to have symbol as an input parameter , so I want an input variable (enum) from which I will choose the right symbol, like this: I have done this by this code: enum ENUM_SYMBOL { EURUSD= 0 , GPBUSD= 1 , USDCHF= 2 }; That works for me perfectly
Just write an ea where u extract latest deal type deal reason and check deal type==sell&& deal reason==deal_reason_sl if condition meets print on screen "check" The ea will make me understand how to use dealinfo
Hi All, I am new in MQL5/trading and was learning its coding. One thing which is very strange for me is that when I call MarketBookGet() function on some symbol, it is giving me totally different values than shown in Depth of Market. I might be missing something, due to which I came here to get
The below code not executing the sellstop order. What is that am missing? I want the sell stop to get executed once the buy order is placed. trade.Buy( 0.10 , Symbol (), SymbolInfoDouble ( Symbol (), SYMBOL_ASK ), 0 , 0 ,commStr); if (count_buys== 1 ){ trade.SellStop( 0.10 ,( SymbolInfoDouble (
My EA opened a BuyLimit with an SL and TP as shown in the image below. The order is not considered a position, which can be verified by doing a "PositionsTotal", that means I cannot use the PositionClose method to lock-in the profit. I understand why there are instances the order is not closed even
I wanted to copy a signal, but found out that there is no Signals button in the Terminal of the MT4, whereas an MT4 of another broker has the Signals button. Is it possible to get the Signals button where it is missing? See the screens of the two broker's MT4 Terminals
Hey guys, I always get error #4756 and I have no idea why... can anyone help? void OnStart () { int totalOrders= OrdersTotal (); for ( int i=totalOrders;i>= 0 ;i--) { ulong ticket= OrderGetTicket (i); if ( OrderSelect (ticket)) { string orderSymbol= OrderGetString (
i'd like to access the last three fixed values of ZigZag Highs indicator (standard one) i have seen other threads discussing the same problem but they are all in mql4 and i use mql5 Here's my code ,but no matter i change the indices , it only produces the last non fixed value of the High
  Are EA cached?  (5)
I've searched this forum and the internet and I did not find any discussion that hints that EAs are cached. I am new to MQL programming and I am trying out a simple strategy to get my feet wet with how it works. I have a simple code that looks like the following: CTrade trade; if (buyNow) {
In my EA below, I have programmatically drawn the default ZigZag indicator. I would like to access the last two fixed values of the ZigZag. How can I achieve this? I saw this post (https://www.mql5.com/en/forum/131897)but I'm not certain how to apply this to arrive at my solution #include
  Focus on MT5  (5)
//+------------------------------------------------------------------+ //| FlipChart | //| Copyright 2022, Yours | //| http://www.companyname.net |
Hello, I am building my EA with the purpose of "not closing" positions in loss. When the Close Conditions are met : a) If the current chain of trades is in profit than close in profit. b) If the current chain of trades is in loss, than hedge the loss by an opposite position with volume = to the sum
The code: void FillArray(PosArray& C) { int total= PositionsTotal (); for ( int i= 0 ; i<total; i++) { CPositionInfo p; if (p.SelectByIndex(i)) { C.InsertSort( new Pos(p)); } Sleep ( 1 ); }
Hi forum, As per the title of the thread, if I have a standard RSI EA running that I'd like to run only between a certain period of the day, is there a nice easy way of doing this? What about if I only want new positions to be limited to a time-frame but closing orders may still work? What about if
Basically the title and if doesn't then how can I get the number of total positions opened in my account across all symbols? thank you
Hi, I tried to install the MetaTrader5 package and I'm getting the errors below. Is there any solution? Thanks. ERROR: Could not find a version that satisfies the requirement MetaTrader5 (from versions: none) ERROR: No matching distribution found for MetaTrader5
I am trying to develop a high-speed scaler EA. Let's say an EA tries to open a trade. Before the trade is recorded the next tick arrives. So the EA thinks the trade is not opened yet. Will the EA try to open the trade again, resulting in two similar trades? In other words, will the EA block until
I need EA who makes pending stop order and if price hit my stop loss i need that the EA make the same pending stop order at the same price that open at the biggining and if price hit my TP do not make any order also i will like the possible to include a manual open price to se and add a pip
Hi guys, need an advise. I use tickvalue for calculating lot size. Sometimes that piece of code returns zero: tickVal = SymbolInfoDouble ( Symbol() , SYMBOL_TRADE_TICK_VALUE ); tickVal = NormalizeDouble (tickVal, Digits ()); I'm using tickValue to calculate Stopp Loss pips risked: double Pips_Risked
Hey All, I want to run optimization algo for multiple currencies. To give example lets assume I will use QQE Histogram to buy or sell. It has following potential input values: input int qqeinpRsiPeriod = 15 ; // RSI period input int
Hello, I want to export MT5 optimizer results to Excel, surprisingly I am having problems achieving this outcome. Below this is my options, but the 'Export to XML' gives me unrecognizable code and certainly not what I am looking for in an Excel Spreadsheet. thanks for any advice, regards
Hello Traders, so far in my EAs it was only possible to have one postion in each direction at the same time. I am saving position attributes like "BuyStopDistance" in global variables. Now I am working on a EA which requires to have multiple positions in the same direction. To manage all positions
I wonder if there is a function enable me to shorten this conditions: if(High[i] > High[1+i] && High[i] > High[2+i] && High[i] > High[3+i] && High[i] > High[4+i] && High[i] > High[5+i] && High[i] > High[6+i] && High[i] > High[7+i] && High[i] > High[8+i] && High[i] > High[9+i] && High[i] > High[10+i]
Profits & all other Fields are not getting calculated for custom symbol in strategy tester.. I have uploaded the setting of my custom symbol Kindly help me how to set this thing up
Hi to all, I want to test an EA but depending of the value of an input, some other inputs should not be considered. How can I do that? I created a static list, and put a key to track the input tested but it seems this approach is not working. Maybe a better approach exists, any idea? Thanks
  EA CODE  (2)
i am asking for help if some one can help me with my EA am asking for a command line that the EA can be useing, if my floting profit/Loss reaches a profit of myabe 10$ then it closes all my open trade and be done for a day till the next day to resume
Hi everybody, like always and done without any problems in previous versions of MT5 I want to test my (unmodified) EA by the strategy tester. But since I've installed MT5 build 2926 I cannot open any pending orders. I get the error messages CP 0 16 : 18 : 13.970 Tester DE30,H1
First some context: As best I can tell, MQL5 can make use of events handled by the Terminal, but they python integration doesn't get or see those events. Mostly that's ok. I don't particularly care about the events themselves (because I can program in python to listen for anything that changes and
All good health. Help to calculate the deposit to copy the signal. To the signal provider deposit 3000 c.u. with a leverage of 1:500. Lots - 0.01-0.02-0.03, etc. martingale system. It is not possible for a subscriber to make a deposit of 3000 USD. There is an offer to make a deposit to a cent
Hello, My problem is that my new bought EA doesn't work on VPS because my VPS doesn't seem to be able to sync web request. I see a lot of error 5200. If anyone has experienced this issue before and have found a solution, I'd be thankful to know how