Download MetaTrader 5

MQL4 and MetaTrader 4 - page 71

To post a new topic, please log in or register
double Buffer1[]; double Buffer2[]; int OnInit()   {       SetIndexBuffer(0, Buffer1);    PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, 0);    PlotIndexSetInteger(0, PLOT_ARROW, 241);    SetIndexBuffer(1, Buffer2);    PlotIndexSetDouble(1, PLOT_EMPTY_VALUE, 0);    PlotIndexSetInteger(1, PLOT_ARROW, 242);...
So I built an EA only for entries nothing else. But for some reason for example when there is a setup on AUDUSD and another on GBPNZD at the same time the robot only take 1 of those trades. Why? What can I do to fix this problem. Im new to coding so please bear with me. I know I said it was only for...
Hi, I wonder if someone can help me. I need to calculate total lost orders from my order history, since the last profit order closed. I can count the orders but i am struggling with the equation of selecting it from the last profit order. Below is my script. Please can someone help out? int...
What would occur in the charts generated if history data from server with different server time is transferred into history file in a new mt4 with different server time. How would the new mt4 treat this new data. Thanks
Say I want on one chart to have 10 sound alerts . I go into the terminal , alerts tab and create the first one. Is there a way to copy this first sound alert and just drag it to the price i want ? And then to copy it again and drag to the next price and so on. Just copy and drag? As the way I am...
Hi, Need support on coding function to close all orders for all pairs with same magic number if net profit equal spasified money amount   I searched around and tried to code it myself but unfortunately not succeed :) Appreciate your support  Thanks 
I want to know if its possible to make this simple custom oscillator where 1. Add stochastic + williams %R for current time frame (-100 to +100 oscillator) 2. Add stochastic + williams %R for M1, M5, M15, M30, H1, H4, D1, W1 times frames, total divided by 8 (also results in -100 to +100 oscillator)
I have a buy order open and closed again. Everything works OrderNummer=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,NormalizeDouble(Bid-Sl*Point,Digits),NormalizeDouble(Bid+Tpf*Point,Digits),"Buy",123,0,Blue); if(Bars > barsCount){    if(OrdersTotal() > 0){       for(int c = 0; c < OrdersTotal(); c++){...
Hello, I'm very new in programming MT4 custom indicators an that's the reason for my very basic question. How can I shift all values of the whole price curve in the chart (e.g close/high/low etc.) continuously "X" bars in the left direction of the chart? This shifted values are "basic" values for...
I entered a sell trade . The price is currently just below my sell price, maybe 2 or 3 pips. Why am i still minus on pips on my trade order? It seemed to me that when I place a trade the spread is automatically applied as when i entered the market my sell order was not executed at the current market...
Hi, im having trouble with something. I want to calculate remaining free available Margin (Not as a % but in dollars) double margin_level() {    double value =0;    if(AccountFreeMargin()>0) value = NormalizeDouble(AccountBalance()-AccountProfit()-AccountMargin(),2);    return(value); If my profit...
Hi,  I'm asking a help or just a little hint, because I'm stuck a bit. I want to integrate 2 different buying/selling opportunity into one EA. They complement each other, since one is buying when the trend starts and the other one buys in ovebought levels. When I tried to build that , only one of...
I want to check if my EA is running in a specified Profile....if so then I want to do some things in other charts, within that Profile. But I really don't see any Chart operation what could check that. I also did not find any information when I search for profiles. Hope somebody can point me in the...
Hello everyone      as shown in the figure, Two price axes for the same window, Different time periods.                                                                 Thans.
I use this ea and it does well. Except it needs TP and SL, especially TP. I have tried other forums. I am given instead very complex versions of xMeter traders EAs. Can someone on tsd forum kindly just add TP and also SL to the attached ea. Thanks and Regards xmeter_mini_trader_v3.1...
Hello how can i fixed indicator that send email , alert and notification for past when metatrader was opened ? i use this code but when i open the metatrader send many notification and alert of past signals ! if (EnableSoundAlert){SendNotification(TimeToStr(Time[0], TIME_DATE|TIME_MINUTES) + "  BUY...
Let suppose that 2 terminals are running in my system and each terminal has few opened charts. My question is that if there is any way to get the window handle of the chart which is currently active using any mql function or system DLL?
Hi there, I haveoccasional failure of OrderSend() on Error4109 with “Allow Live Trading”checked. It does not happen all the time. I also noticed that the same trademay go through in a different account at the same time. My EA is fully self containedand does not depend on any external inputs....
Hi, ‌‌Does anybody know the meaning of the following error: ‌EventSetTimer(xxx) error 1158 ‌‌ (‌xxx: time specified for the timer within the EA) ‌ T‌hanks in advance!
I have rented a nice dedicated server with decent cpu and 16 gig ram. I have encountered a problem though - I am not able to run more than 32 terminals at the same time. If for example I want to run Terminal33 it is not starting, but if I quit Terminal 1 or any other, I am able to start terminal 33...
I've been using the GlobalVariable....() functions to create my global variables for my EA but am wondering if I'm making life too difficult for myself. I will be running this EA on multiple charts in the same terminal at the same time and have been using the GlobalVariable...() functions to avoid...
Hello to everyone, i would need to use this operator || Between functions but I give you an error: 'if' - expression of 'void' type is illegal. if( myFunction1() || myFunction2() ){      myFunction3();}
Hi Gents, I have the following code  it works perfect on my EA  tester but when it comes to automatic validation  it fails int start()  {//----int TCC = 0;   for(int ii = OrdersTotal()-1; ii >= 0; ii--) {     if(!OrderSelect(ii,SELECT_BY_POS,MODE_TRADES)) continue;  if(OrderSymbol() != Symbol() ||...
Comments that do not relate to the "Spread filter for EA", have been moved into this topic.
Please help with my spread filter. I'm using ECN 5 digit broker but when I use this code, the ea doesn't seem to read the spread correctly. On my EA I do normally put an extra 0 eg  500 for a take profit of 50, just as an example ( I've tried to add/take away 0s with no luck). Is there and easier...
Hello guys. Can you tell me if the code in this way can be correct or where i`m doing wrong? Thanks to everyone.     //++++ Spread Filter    extern double MaxSpread = 5.0;    int MarketInfo()        if {(StringFind(Symbol(), "JPY") >= 0){ {Spread = (Ask-Bid)*100; } else {Spread = (Ask-Bid)*10000;...
Hello  every one  the Below Function is to get the Last order lot size and multiply it by 2 it is is lose trade but it is not working properly , can you help  double fLotSize(){double fnewlot=Lot_size;int i =OrdersHistoryTotal();for (i;i>=0;i--){    if (OrderSelect(i,SELECT_BY_POS...
Yes i know that you can make any variations of the trailstop put into a script or EA, but i`m curious how the built -in trailstop work. So for example: if i enter long at ask 1.2345 , and the stoploss is 20 pips (1.2325), but the trailstop is 10 pips then after the price goes to 1.2346 the new sl...
Hi How do i get the highest AccountBalance(); between two dates, for example between 2015.01.01 until now?