Expert Advisors and Automated Trading - page 108

To post a new topic, please log in or register
Please someone help me with converting iMA function from MT4 to MT5. I need call iMA with other pair and different shift. I do not see the input shift with the iMA for MT5. mq5 compiles without error but while testing it give this error: " (EURJPY,M5)    cannot load indicator 'Moving Average'...
Hi, I don't know what is the command that "exits" the function/procedure/event without execute the rest for example my code below... tks   void OnTick(){   bool RoboON = false;    if (checkTimeLimits(StartHour1,StartMinute1,EndHour1,EndMinute1,TimeCurrent()))    RoboON = true;    if...
Are any of you familiar with a script that start an EA at set time and stops it at set time....suggestions..
Hi, I need a function  (close_all_orders)   that close all opened positions by the EA. The idea is to close all opened positions by EA after the end of day  void OnTick() { if(Hour()==16 && Min()==55)  close_all_opened(); else ExtExpert.OnTick();  } 
Hi All, How can know from EA that it's already running in the terminal? The solution I'm thinking of is to set global variable onInit EA_ACTIVE and remove it on deInit, when you try to run another copy of EA it will check that EA_ACTIVE exists and return onInit_fail. The problem here that the user...
In my brokerage for mt5 , I have costs for operations,  where I can calculate using "cost per contract (= sell+buy or buy+sell) " or "per order (=sell or buy) " Cost per contract = 1.0 // 0 = use "cost per order" Cost per order = 0.5    //  0 = use "cost per contract" How can I use the costs to make...
Hi, need a sample EA with two move averages I request this, because I create a EA that have other components and move averages, the components are displayed in backtest and while in a windows (running the EA), but the Move averages aren't display in a windows (running the EA), only display in back...
Hi everyone. I' programming my own EA which opens a lot of positions on the same instrument. So far so good, but now I have trouble identifying which pairs belong together, I mean which closing position belongs to which opening position. I can add a comment when opening a position, but I can't find...
Hello, can some one tell me if this a Broker or EA fault? The price was never down there Thanks.
Good evening,   I'm sure this questions has been debated before, but the search turned up nothing. (Btw, is there a  function to search only a sub-area of the forum??) What is your experience with better execution (or lack thereof) when using a low latency server rather than any standard offering of...
forexparvenu
as above, how to coding scalping strategy MT5 ? 
Helle,   in older days, the order expire was a function of Seconds,   now it use the datetime and this is a miracle for me since i use MQL4. can someone help me, how do program on a pending order, that the expiration is after 30 minutes?   OrderSend(Symbol(),OP_SELLSTOP,Lots,Price_Sell,Slip,SL,TP...
While using an EA for US Futures markets, do we set profit and loss in pips or points? For example the ES moves in increments of 0.25 and bonds move in increments of 1/32. Did not see fraction in MT5 either. Thank you. 
Is it possible in mql5 to program a strategy for SP500 to only take a trade if Bonds are in an a uptrend? Can an expert advisor refer to another instrument than the one traded? (Could be Bonds, #tick,  other indices?) Best regards //P  
Dear Users, I am trying to apply a Custom template using EA in MT4 platform but it is not getting applied on chart.  I tried with following options; ChartApplyTemplate(0,"\\Custom.tpl"); ChartApplyTemplate(0,"Custom.tpl"); ChartApplyTemplate(0,"C...
Hello, I have one question but first I will describe the situation. I have 7 MT4 accounts that are installed on the desktop VPS (SocialVPS). Then I got all 7 accounts registered in mql5 Virtual Server. Now the question: MT4 should be running, or can be switched off to EA (Basket Trading Exper...
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...
All the indicators return an int value, called handle. Do they mean pointers?
Hi to all My main problem is ==> i don't have the color of last dot in magic dot indicator with (iCustom function)!! double s = iCustom(Symbol(),0, "Magic dots 2 mtf alerts", 0 ,MODE_EMA ,6 , 0 , PRICE_CLOSE , false,false,true,false,false,false); I Commented (s) and the out puts doesn't mach with...
Hello,   i try to convert my EA from MT4 to MT5 and now i have the problem to close all position, in MT4 it was easy to say at a spezific time to close everything. now on mt5 i use following code      if(Minute()==00 && Sekunde()==00)      {       if(PositionSelect(_Symbol)==true)         {...
Hello, I believe if I run an EA in an ecn account then market orders open in two stages: 1- The order is first opened and then only after that the 2- the stop-loss and take profit are placed. Most of the time this is not a problem but occassionally my stop loss order and take profit order are not...
why do people use this protection in their EA? I mean, if you make your MT4 window smaller, you WANT the EA to continue trading, right? But with this protection, the EA will stop working and won't open any orders. I think it's useless, because if you don't want to trade, just turn off the EA. Or...
Hi,  I want to write an script which I should use file commands to store some data like names of stocks in it, but it will be overwritten everytime I open, write, and close the file. What should I do to keep previous file data and write the new data after them on a text file everytime I run the...
Hello,  How are you doing? Hope you are doing well.  I have coded an EA to trade in H4 periods. I'm having an issue and I can't solve it, even if I've been trying it since a lot of time.  This is the issue: The EA is NOT opening or closing the orders when the H4 bar is closed. I need the EA to...
let's say I've develloped an EA that i want to test. On how many years should I test it to say that it can be used with confidence on a certain timeframe and currency pair ?
  timing (11   1 2)
Hi I I have this EA and I was wondering how to make it wait 1 minute after it gives me an alert before it does its job again.   currently it is echoing the alert nonstop until it meets its goal. what code do I use ?  
Hello I wrote an EA and I want to close  my all open position but always "EURUSDPositionClose() method failed. Return code=10006. Code description: rejected" Why? I use void CloseAll() { for (int i=PositionsTotal()-1;i>=0; i--)   {    {     PositionSelect(PositionGetSymbol(i));     if(!m_trade...
How to auto-indent a whole code quickly?   For example, whenever I copy/paste code from a webpage or ebook it looks like:     if(SellTakeProfit > 0) SellTakeProfit = AdjustBelowStopLevel(Symbol(), SellTakeProfit,5); AddStopProfit(SellTicket,SellStopLoss...
Hi I developed a EA using CExpert, and create my signal using nrtr_atr_stop.mq5. Also I created an trailing stop based in same indicator. (class CTrailingNRTR_ATR : public CExpertTrailing) but what happens is that the indicator use two buffers, one for UP Signal and other for Down Signal. In...
  iCustom adressing (12   1 2)
Hello to the expers, I want to see/check custom indicator values in an EA. This variation on built in indicators works fine: OnInit part:      MA_handle=iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE); OnTick Part:      CopyBuffer(MA_handle,0,0,100,MA); ArraySetAsSeries(MA,true);     Comment(MA[0]);    the...