Download MetaTrader 5

MQL4 and MetaTrader 4 - page 40

To post a new topic, please log in or register
Hi all, I'm   running an EA   on 3  different charts and i'm wondering if someone knows an mql4 code that automatically closes  all trades when a set total  profit ( pnl) is reached. Is it possible?  Please help. Thanks.
Hi MT4 programmers, I have indicators that create objects.  For a few of my indicators, I might add more than one (of the same indicator) to a chart. A problem will occur if the indicators both create and delete the same object names.  Therefore, the usual workaround is to use a user-defined...
Hello all and thanks in advanced. I am trying to only open new orders if they are going to be opened in not the same price as any of the already currently active opened orders (MODES_TRADES, not MODE_HISTORY). In other words, I don't want 2 open orders with the same OrderOpenPrice() for my scalping...
extern double Lots = 0.01;extern int Slippage   = 3;extern double TP = 0.00200;extern int MagicNumber=11111;string text = "Forex Mudah";int init(){   return(0);}//+------------------------------------------------------------------+//| expert deinitialization function...
Print (MarketInfo(_Symbol,MODE_BID));OrderSend(_Symbol,OP_SELL,0.01,MarketInfo(_Symbol,MODE_BID),0,0,0,NULL,0,0,clrNONE); Notice how, upon utilizing the code above, in the Experts tab you will see that there is sometimes a discrepancy between the MarketInfo(_Symbol,MODE_BID) and the actual price at...
I hope to write a function PrintVars that is able to print the print variables with their names. e.g., int var1=1;bool var2=true;int var3=2;PrintVars(var1,var2,var3); The output to the console is: var1=1var2=truevar3=2 The difficulty here is to Get the variable name; passing parameters of various...
Hello everyone, could someone please tell me if it is possible to intercept window chart moving event? (it has to happen when dragging chart window by mouse). Thank you
Hello,  I have problem to use GetMessage(...) Win32 function to intercept Windows msg. Could someone please help me with a little example if that is possible? Than you
Supertrend is an excellent indicator which accurately notifies the trend of forex pairs well in advance i have used it and made $ thanks a lot can any one please make an EA based on supertrend indicatorPlease Please plese
Hi All, Could someone help me with how to use the iRSIOnArray function. For example, why does this not work? double RSI = iRSIOnArray(Close,0,10,0); I'm just playing around with it to try and understand how it works. When I run this it returns zero. I assumed the Close array would be fine to test it...
Anyone have idea on how to do the following? An order was opened within this bar. And after the current bar is finished, a new order will be opened. I tried play with the time, but it doesnt help. Are there anything wrong with my code? And any alternatives I can take to do this? *Without...
Hi Guys, How was your day or trade, hope its okay. Today i wanna share you my EA Script, hope you like it. :) extern int MagicNumber=20170601;extern double Lots =6.01;extern double MinLots =6.01;extern double FixLots =6.01;extern double Risk=30.0;extern double MaxLots =1000.0;extern double...
Keeps borking out, really feels non-intuitive that its not there. There should be a checkmark just like in the Experts tab right click menu. My 2 cents. Auto scroll toggle feature upon right click should be there for all tabs, not just Expert tab, really. Would make MT4 better.
Why does this code produce a wrong SL sometimes yes sometimes no? OrderSend(_Symbol,OP_SELL,.01,Bid,0,Bid,0,NULL,0,0,clrNONE);
Hi, please help how can I write ticks into a CSV file (in MQL4) so that another program (MS VC++)  can use them real-time.  Thanks, jfekete
Hey Guys, Could someone help me out with this indicator.  I have tried to get to alert at NEXT BAR CLOSED but failed...... Thanks in advance Alan
Hi, I have been currently running my EA on a demo account "EURUSD". However, everytime i move from an hour chart to 15 mins or any other. The EA restarts and places additional orders for conditions that have alreay been met in the previous time chart. How can I stop this problem ? Regards, Paramoo
this is more of a  gee whiz type question, but not knowing the answer tends to annoy me..... does anyone know why "EnumToString((ENUM_TIMEFRAMES)Period())" will not work in stop or limit orders.... it will work in market orders.....  yes it's a seemingly minor issue especially when just using...
When we OrderClose a position partially (say you buy at 2 lots but only close for 1 Lot), it will open a new ticket number, but how do we know that ticket number specifically?
Hi, I'm trying to write an arrow when I cross FiboLevel but I can not if(iCustom(Symbol(),PERIOD_CURRENT,"Heiken Ashi",2,1) > iCustom(Symbol(),PERIOD_CURRENT,"Heiken Ashi",3,1) && iCustom(Symbol(),PERIOD_CURRENT,"Heiken Ashi",2,1) < ObjectGetDouble(0,"Fiboo",OBJPROP_FIRSTLEVEL,0)     // Cross Fibo...
Hi, has anybody recognized this 'feature' as well - may as well in mt5 too? Developing a multi-symbol-system I do:       ResetLastError();      int cop1=CopyRates(Sym, PERIOD_M1, 0,3, τRates);      errCheck = StringFormat("%s cpy:%i ArrSz:%i err:%s",Sym,cop1,ArraySize(τRates),_LastError); I now I...
when I see the backtest results, there is a Result panel (see, e.g., https://quivofx.com/wp-content/uploads/2015/02/result.png) that listed all transactions for the backtest. Is there a way to quickly scroll to the relevant portion of the graph? For example, say buy on 2017.05.03 10.30 EURUSD 5 Min,...
Hi guys, So yeah, the question is in the title. I have an indicator which uses IndicatorCounted() to find out how many candles have not yet been calculated since "last time", but when i switch back and forth between two timeframes, IndicatorCounted() is always zero and thus the whole thing gets...
Hi, I have a small problem with the correct placement of a text object. I would like to assign a number above the High of Green Heiken but the result is not optimal. In some assets it's okay and in others no but I do not understand where I'm wrong. ObjectCreate     ("N",OBJ_TEXT,0,Time[8],iCustom(0...
(Just started learning couple days ago,apologies for the sloppy coding) Just wrote an EA which long when  (FastMA2<=SlowMA2&&FastMA1>SlowMA1) and short when (FastMA2>=SlowMA2&&FastMA1<SlowMA1). Only one position at a time. I tried using OrderModify to close the trade just to get used to the...
Hi,  I'm stuck with a problem for days and i have no clue what i made wrong. Please help me if you can.  so under the start() I have the following code: void CalculateCurrencySlopeStrengthMA(int tf, int shift){   int i;   // Get Slope for all symbols and totalize for all currencies      for ( i = 0;...
Dear Coders, I am trying to create a new indicator which plots a histogram based on the following calculation w.r.t the Pivot points, both current and past.     Pivot = ((PreviousHigh + PreviousLow + PreviousClose)/3);    BC = (PreviousHigh + PreviousLow ) / 2;    TC = (Pivot - BC) + Pivot;     if...
Well this is my situation: I speak about two include files: Errors.mqh and CmyClass.mqh both in ..\MQL4\Include\ which I want to compile individually to detect 'grammatical' errors! I created a class CmyClass.mqh which contains the class method: bool CmyClass::sndOrd(..) the mt4 call OrderSend(..) -...
Hi guys, I was hoping someone could help me out. Coding is not a strong point for me but I am trying! I'm experimenting with basket trading and would like to try something out but I'm not sue how to do it. Assuming I have multiple sell orders spaced by x amount. When I reach a certain number of...
Always when I re-start MT4 my toolbars have diappareared as well as my terminal. Whatever i try with profiles, it does not help. Anyone knows what I should do? Thanks.