Expert Advisors and Automated Trading - page 50

To post a new topic, please log in or register
for ( int TrC = OrdersTotal() - 1; TrC >= 0; TrC -- )   {        if ( !OrderSelect( TrC, SELECT_BY_POS,MODE_TRADES ) ) { Print( "OrderSelect Error #:", GetLastError());  continue;  }      if ( OrderSymbol() != symb || OrderMagicNumber() != mgn ) continue;       //symb is desired symbol and mgn is...
Hi,  Maybe someone have met such a problem before. After I start my EA it places both pending orders, but doesn't print anything. And it doesn't give any error. Just like it didn't see those two "if - else" operators below orders. Both orders are places correctly, so everything declared inside...
Hi guys, I am totally new to programming and I am getting crazy of this error. It always gives me Error 0 with "ticket_1". I have no freaking idea whyif(ticket_0==0 || ticket_1==0 || ticket_2==0){            SL_0 = Ask - 200*_Point;            TP_0 = Ask + 100*_Point;            ticket_0 =...
hi guys i'm a professional coder of mql4/5 EAs from several years i'm specialized in backtest optimization on custom data on mt5, using most advanced optimization tecniques, using special formula for custom optimization criterion working primary on backtest optimizations, my obsession is obviously...
>>> can you help me please ? I can not find the equivalent in MQL5 doing sort for ((( string values ))) .... this my code in MQL4 and ArraySort works OK in string values string x[];ArrayResize(x,OrdersTotal()+1);for(int i=0;i<OrdersTotal();i++)      {         if(OrderSelect(i,SELECT_BY_POS...
I want to code Zig Zag into an EA. The Zig Zag custom indicator that i imported into the EA Builder program comes with three Buffers.  Hi, Low and Zig Zag buffers.   But on the chart , the data window only shows the one Zig Zag buffer and it only has a value at the points where the line is drawn to...
Hi, I created a EA scanner which can scan stocks from Market Watch and displayed all stocks in each button with name. After few mins all objects are flickering and disappearing. Kindly see the video for better understanding. https://gofile.io/?c=6qkya5
Hello community, when  open symbol information from market view, i can see trading hours for symbol. But i do not find a corresponding function to fetch this information. How do i know, if am currently in trading hours for symbol ? Thank you
  Hedge
Im trying to make a hedge but it wont perform as I want. If I have several orders open in the same position (Have already defined openorders as that), i am defining it that my EA has failed. So then I want to check the trend by using MA on 320 on 15 min charts if its either an BUY or SELL...
I am using simple FileReadString(FileHandle) in my EA AceDeal. In text file Command.txt (Placed in Terminal Data Path) is simply string 0.1. Why FileReadString() cannot normally read that string?(???)
 hi guys, this is the point: Supposing in 1 instant I have onTick() and OnChartEvent(), which one gets priority? I know when we are inside onTick(), other onTicks events are ignored....what happens when we are inside OnChartEvent()? Thanks a lot.
Hello, I m trying to publish a dashboard expert under metatrader 4 experts section. During the validation I receive an error saying "There are no trading operations" .  Dashboard expert doesnt take any trades. So how can i solve this issue ? I cant add it to indicators section because of it is an...
I'm using the native OrderSend() function in order to open a new position using the below function: uint SendSLTPOrder(long const magic_number,ENUM_ORDER_TYPE orderType,double volume,double price,double stopLoss,double takeProfit)  {   MqlTradeRequest request={0};   request...
Who can optimize my EA from historic data for long term to get better settings for the EA.
  We all know false breakouts are strong market movements.  Can anybody tell some code idea how to check a false breakout? 
Hi guys, I am searching for an Expert advisor which opens Positions when the stochastic oscillator crosses lines positively and the MACD Histogram indicator also crossed the lines positively, do you know such an EA? Thanks a lot in advance
Hello Friend, I am new to mt5 . I am learning mql5 coding. My EA works like this ----------------------------- indicator RSI(14) Buy = RSI  cross 30 from  bottom Sell = RSI cross 70 from top I need help to develop a code 1)  open buy position if there is any buy signal and close if any sell position...
We will describe all the settings for the Brainwashing EAs starting from 1c version.
Dear, I want to know what is different between Symbol() function and _Symbol variable. I know both return current symbol name. but which should i use.
hello guys, I am trying to optimize my EA I ordered in freelance, but after the first 500-504 steps the process goes infinitely slow. The cash is going out from my account with light speed but the processing of the optimization is taking forever, can anyone give some sort of advice how to optimize...
This is the code to my Expert Advsor//+------------------------------------------------------------------+//|                                                  masterpiece.mq4 |//|                        Copyright 2019, MetaQuotes Software Corp. |//|...
Hi all, I'm facing a problem when using strategy tester. As the picture attached shows, it just ignore my TP and SL and go ahead with the trade. Is there any solution for this problem. I'm using MT5, build 2085. Tks!
The attached is a bad strategy for testing only (don't actually trade it). On axitrader it won't open during live trading but it will open during demo trading and in the strategy tester (yes, I have a smiley face, enabled auto trading, etc.) It was generated with  fxpro quant. I...
A few sentences in advance before I come to my question: unlike in live trading, I usually don't give much attention to the "official" balance that I get in the strategy tester via AccountInfoDouble(ACCOUNT_BALANCE). The reason behind this is that - with a low spread ECN broker - I need to emulate...
Hi, I know it is possible to know if an optimization is running using MQLInfoInteger(MQL_OPTIMIZATION), but is it possible to know which kind of optimization it is (e.g. genetic or complete)? Thank you, Tuche.
I'm having a strange anomaly with the Strategy Tester. I have coded a very simple EA that places Buy and Sell stops with SL and TP values. The Volume is calculated to use the difference between the Buy and SL in order to limit the risk to -1% of the account balance as per popular recommendations...
Hi, What is the best method to stop interference when running EA on multiple pair? I'm getting wrong indicator from the wrong pair on my chart. Would something like below do the trick by using _Symbol == _Symbol ??   if(BuySignal>=NumberOfSignal && _Symbol == _Symbol)     {      SellBuy(BuyAmount...
Hi, I am running some optimisations, and with some more aggressive settings, the algorithm performs very good, but when I do a single run, it turns out that stop out occurs. What would be good, is not to include the original score of how good the algorithm performed, but in case it was terminated by...
  Close Price (3)
Hello everyone I want to know at what price has closed an order. There is HistoryDealGetDouble (ticket, DEAL_PROFIT) which provided the profit, HistoryDealGetDouble (ticket, DEAL_PRICE) which provided the opening price but surprisingly, I do not see anything for the closing...
Hello, my target is to save from Expert Advisors two different sets of information in order to work with that data offline.To do that, I used FrameAdd to save the data. Having two different arrays I used two different IDs: FrameAdd("Stati",4,(double)dati_rep.numperiodi, dati_rep...