MQL4 and MetaTrader 4 - page 943

[Deleted]
Hello,    I am trying to come-up with solid functions for opening and closing orders.    Here is the routine for closing I am currently using:    The main issue is I often get error 129, and the routine exits leaving my position open. I won't post the opening function, but it is very similar and...
[Deleted]
How can I get an array from a string using MLQ4?  In the code below, the alert is blank:   int start() {    string aPair[];    string Pairs = "EURUSD,USDJPY,AUDUSD,EURCHF,USDCAD,EURGBP,NZDUSD,EURJPY,GBPUSD,USDCHF,GBPCHF";    StrToStringArray(Pairs, aPair);    Alert(aPair[2]);  // Should alert...
  40/100 = 0 why?  (4)
I just test this one Comment(" 40%= ", 40/100); it show me 0, why?
[Deleted]
How can I remove all non-alphanumeric characters?  This does not work: Alert( AlphaNumeric("Hello 123 !@# WORLD") ); ///// FUNCTIONvoid AlphaNumeric (string istr)   {  string other="Aa";  string ostr = "";  for (int i=0; i<StringLen(istr); i++)  {    string s = StringSubstr(istr,i,1);    if ((s >=...
[Deleted]
Theoretically speaking is it logical to say use a recent time period for in sample optimization and then use a backward time period for out of sample testing. For example optimizing a system on 4H data for 2012 and then use 2011 H4 data for out of sample testing. Will the results of the system be...
Hi all, Is there any code/indy known to be available which would calculate exposure to individual currencies. That is, let's say I am short EURUSD 0.5 lots, long AUDJPY 0.25 lots and long USDCHF 0.5 lots, I want to know my individual exposure to EUR, USD, AUD, JPY and CHF (totals for each). I think
[Deleted]
do i need to be a computer wiz to be able to use meta trader..i friend just let me on to it, and i have to say im a little bit intimidated(that in itself is an understatement)
Hi all,    What I'm looking for is way to get a signal to open orders based in datetime I mean,  if time now is different from time previous then the price will obviously be different and so if  Bid now is n pips above (or down) the Bid of time previous then a condition is created to open an order....
Hi I want a horizontal line on my chart thats always is for example 15 pips fom the price, one line above and one below price. Is this possible in metatrader 4 original functions or do i have to use an custom indicator? In that case does someone know any indicator that will fork for this purpose? 
[Deleted]
  Chart pattern  (4)
Hello, when we built an EA and we make a back test, we open the chart to see where it works fine or not and try to correct the mistakes... MT4 always opens it's own default chart. With grid and it's own indicators colors... Is there a way to control this? To use the default pattern I have saved, or
Hello dear friends... I have MT4 on my iPhone 3GS, but iOS 6.1 and everything seems cool, except one thing. There is no the red "TRADE" button there. Only "Chart", "Details", "Cancel". Anyone met my problem and know how to solve it?  Thanks..  ( here is the screen shot)   http://oi48.tinypic...
[Deleted]
Hi, Can anyone tell me why the price scale on MT4 charts is not uniform?  As can be seen from the attached image, the interval on the price scale varies. The values and interval are here: Scale Value Interval 1.32925     0.00120 1.32805     0.00115 1.32690     0...
[Deleted]
Hi guys, i want to show a text object in the left corner of the chart window but with this code a can never see a text object. What is wrong? I can't find the right solution by myself. int init()  {  ObjectCreate("Text1", OBJ_TEXT, 0, 0, 0);  ObjectSet("Text1", OBJPROP_XDISTANCE,...
  help me  (1)
double ma7, ma20, ma65, ma200;   double stoMain_0   = iStochastic(Symbol(),0,14,3,3,MODE_EMA,PRICE_CLOSE,MODE_MAIN,1);   double v1 =iRSI(NULL,0,14,PRICE_CLOSE,0);if(  stoMain_0 > 20 && v1>50   ) siCurrentDirection = 1; //up   if(stoMain_0 < 80  && v1<50 ) siCurrentDirection = 2; //down i want to set...
[Deleted]
  Infinite Loop  (5)
My second attempt at MQL coding was a designed to extract and display (in the Alert window) some environment variables (min lot size etc etc).  I appear to have cocked this up and now I cannot launch MT4 without it looping and gradually eating more and more memory and CPU cycles.  Is there a way to...
Now I have make a function which can draw line on K lines graphic as below: int LineNo=0;void iDrawLine(int myFirstTime,double myFirstPrice,int mySecondTime,double mySecondPrice){ string myObjectName="Line"+LineNo; ObjectCreate(myObjectName,OBJ_TREND,0,myFirstTime,myFirstPrice,mySecondTime...
Just as the subject, the detail is as below: This company which i want to join is trading FX, Gold and Future by EA on MT4. I have studied investment and  speculate about 4 years, but I still work for a biology company during these time. Most time, I want to go to this field (investment), but i...
Hi, I'm writing a code which is used in Visual Mode(F12), it's to simply draw candles of different timeframe.  Say I'm in M15 chart, and I want to draw H1 candles in separate window. I did a test : draw a line with "iHigh", time is in year 2009. It's odd: the indicator line value is actually today's...
  Which EA is best  (1)
I'm so new on mql4 EA. Is there any free EA that can bring daily base profit?   Thanks 
  Trailing fails  (6)
Hi all, The code works fine, but sometimes it fail to start trailing. Could anyone get why ? The Trailing Stop should start to trail once MinimumProfit is reached. I've even change the position of line that makes the Trail start.  The ea is to work with an ECN broker.  Here is the code that works...
Hi, my name is Piero and im new to this forum, hoping to get help with this EA. I did find it on the net and was written by Ronald Raygun. I do like the EA a lot, has one flow. The EA opens trade according to the previous candel, therfor is TP and TS worhtless why he opens right after again a trade....
hi, is that possible when there are 3 open trades and if i close trade 1 then trade 2 or/and 3 can be closed forcefully also at the same time by following the trade no. 1? any ea or anything else available for that task? thanks in advance. best wishes, boomboom
I have been looking at custom Indicators that draw on the screen, Horizontal Lines for Entry points . Is there a way to  enter trades using an EA's " Ordersend " at these lines on the chart ? The don't have "setindexbuffer" so I can't use icustom. Any assistance is appreciated.  thanks.  
[Deleted]
Hi All, I'm new to MT4 and have been really struggling to convert a short MACD scrip to use a custom indicator with the MT4 API. The script below if for a MACD crossover and histogram chart similar to MT4's default one, however the histogram is color coded to indicate if the %K line is positive or...
[Deleted]
Hi, i've this code i'm working on:    double max_risk = AccountFreeMargin()*Risk/100;   double sl_points = MathAbs(ObjectGet("P1", OBJPROP_PRICE1)-ObjectGet("P2",OBJPROP_PRICE1))*MathPow(10,Digits);   double tick_value = MarketInfo(Symbol(), MODE_TICKVALUE);   double lots =...
None of the operators fit. Is there any other way without if(A || B || C || D || E) Action;? I ask moderators not to send to general questioner thread due to importance of question I am thinking about and can't find more rational solution! Thank you
Sometimes it takes long before your program is published in section Code Base The new Code has to pass a proofreading So when you see a new published code You may expect a little quality ....
[Deleted]
  SMS messages and MT4  (14   1 2)
Hello again I'm looking for a solution to sent SMS text messages from my EA to my mobile phone ? Has anybody some experience with this? A tip ? A possible solution ? Thanks.
Hi all, I've a question regarding arithmetic operation between OrderProfit() and OrderCommission(). Say that I want to find out  when a n order is in profit, I mean if an order has it's own commission which is fixed then  order "clean" profit should be OrderProfit() minus OrderCommission(). So if...