MQL4 and MetaTrader 4 - page 522

Hello to all I'm writing an ea for mt4, I wanted to open an order with a size dimensioned to 2% risk relative to capital I wrote the following code, when I go to calculate the size, gives me a size of 14 lots, using a demo account by EUR 5,000 and a stop of 50 pips. Obviously it is wrong, you tell...
bool MySelect(int iWhat, int eSelect, int ePool=MODE_TRADES) // MySelect bool initiation, value given below // so I'm thinking to add in a myselect function for Buy and one for Sell.. as i simply dont understand 'return(OrderType() <= OP_SELL);'   {    if(!OrderSelect(iWhat, eSelect, ePool)...
  Error131  (12   1 2)
Hello, I am experiencing the error 131 by using the following code:     if(AccountFreeMarginCheck(Symbol(),OP_BUY,Lots)<=0 || /* NOT_ENOUGH_MONEY */GetLastError()==134)      {       Alert(BalanceErr);       return;      }    else      {       RefreshRates(); double OrderPrice=Ask;...
[Deleted]
  TDI Red Green EA  (10)
Hi Guys, I'm currently working on an EA. I got an TDI Red Green Indicator. Every time there's a cross of both lines, there shall be ONE trade. So if the red line crosses above the green line, there shall be Short trade and every time the red line crosses below the green line there shall be a long...
So im writing a EA that will make use of live trade historical during optimization and i thought of writing the results to a csv when running and read during optimization. Option #1: Read the scv during init and write to array? Option #2: Read from a database(sql, etc..)   Is there an easier way ?...
Hi,  I need some serious help with modifying my scripts.  I think it will take me days to months to try to understand and come up with the coding myself. I learnt a trading concept from a trader online and tested it using my live account. I would say, the probability of winning is high and I have...
void tick{ //How would I get WantedValue to test against if(CurrentAsk < PreviousAsk+WantedValue){ OrderSend(XXXXXX); } } //////////////My Functions double My_Function(double WantedValue){       WantedValue = 0.051;       return (WantedValue); }
  set 12:00 am  (6)
Hello to all. taking as an example the code iBarShift, how can I change the date in the hour 12:00 AM of the current day without having to continually change the day? thank you datetime some_time=D'2016.12.02 13:45';       int      shift=iBarShift(Symbol(),PERIOD_CURRENT,some_time);...
Hi All,   I dont know if im having a dim moment and over looking something really simple. Im not a big time MQL coder got into this quite recently but am pretty skilled in VBA.   Ive build my own EA using some Custom Indicators but these indicators could use some improving so stripped them down to...
Hi, i need a help.... This is my first EA and i am a beginner... can anyone help me to put Trailing stop for my EA ... i tried many ways but trailing stop is not activating when i am putting it on strategy tester... please help... this is my full EA(based on CCI for H4 and Daily TF, preferably...
Hi Experts, i need know when the last minute of day is running in my EA. It's for backtesting years of DAX-Index in order to close some postions at end of day. Usually it's always the same time hour=21 && minute=59. But unfortunately during years it has been changed in the DAX-Index often and my...
Is there a function for this dashed line between opening and closing arrow of one trade?
Hello I want to know how to calculate the initial negative profit immediately after opening a position. Is it just a function of spread and lotsize? Or there are something else that must be considered//?  Please tell me the formula for calculating this.   thanks 
  Minutes elapsed  (1)
How to calculate the minute elapsed since opening a position Can this be true: if(TimeMinute(TimeCurrent())-TimeMinute(opentime)>60) { .... }    
Hello,   I was wondering if anyone had any example code for opening trades during certain days.  I'd like to only open trades Sunday (when market opens) until Thursday.  If the trades are profitable by Friday, I'd like to close them out.  I'd like to do this to eliminate gap risk over the weekends....
Hi, I'm hoping someone can me please? I have been writing in mql4 a dashboard for my trading strategy, I have about 20 pairs open as well, and the dashboard provides a central place to report various information. I have coded a button (I'm using rectangle label) and passing the chart ID by a click...
Hi,  I´m assuming this question came a lot but I couldnt find anythin helpful.. Currently My ea works like: if(OrdersTotal()==0){ placing order ... etc .. }  The problem with the code above is, that it stops trading as soon as one order is open regardless of the conditions to open a new order. So...
Hi Everyone, Backtesting an EA and have noticed some incredibly strange profit results: Long trade is trailed out 4 pips above the entry price but results in a $67 loss Commission charge is only .7 pips, so should still be a 3.3 pip profit. Account is in USD and lot size .21 = $2.10 / pip. Any...
Hi guys, I am developing an EA and one of the exit strategies is when the RSI flats out. For example: http://d.stockcharts.com/school/data/media/chart_school/technical_indicators_and_overlays/relative_strength_in/rsi-2-rsplot.png Look at between 3 and 5. The peak becomes flat. In these moments, I...
  mediate the price  (13   1 2)
Hello everyone,I explain this problem now ... how should I do to open a position, in the same direction of the first position, only after another loses for example 100 pips?I do not take the stoploss, I just need to open a position that you will close to target or if it goes back again to 100 pips I...
I'm new to MT4. When I save a profile, such as EURUSD with three different time charts, then open another profile such as AUDUSD with three different time charts, I now have all 6 on my display. It seems to me that I should be able to change profiles and not pile up charts into one view.  What am I...
Hi, Is it correct that live the time of MqlTick does not show fractals - the last one from Friday doesn't show any? Fractals would mean that each new tick would have a different timestamp (fractal) than the previous one, while otherwise several ticks within the same second would have the same...
I have a live account with tradersway.com and I want to open and use two MT4 accounts at the same time with different account numbers on the monitor.  Please let me know how I can do this.  
Hi I'm new in Mql4. I'm trying to create an ea based on the choppy market indicator. I've identified the buffers as follows:    double cma=iCustom(NULL, 0, "CMI",60,10,false,3, 1);//smoothed ma    double cmil = iCustom(NULL,0, "CMI", 60,10, false,0,1); //cmi line    double cmilg=iCustom(NULL,0,...
Hi guys, I'm trying to place a short order via OrderSend but I get error #130. Since I'm a noob in MQL development I'm sure you can solve this issue really fast. :P So here's the code snippet: double takeProfitTotal = NormalizeDouble(Ask-(TakeProfit*Point),Digits); double stopLossTotal =...
Is there any way to execute a code on an external event instead of executing thre code on every tick? For example when a .txt file in MQL/Files folder gets refreshed.   The idea is to send information/quotes to MT4 by an external (e.g. Java coded) program. This (Java coded) program creates/refreshes...
i have  subscribe in signal Small to big money please how i can changing lot size to 0.02 or 0,03 thank you very match 
Hello, Can anyone please add a stop loss based on pips for this script. This script launches multiple orders simultaneously Set manually s stop loss of 40-50 pips when we execute this indicator. Able to set a stop loss for EUR/USD order 40 pips Able to set a stop loss for EUR/GBP order 50 pips Able...
Hi guys  I wish to have the MT4 to have the prices update when the market is closed (weekend) so I can test EAs immediately while I am coding them without backtest. The data prices obviously are random or past data. Does anyone know of  way to do that  or a plugin that allows that?    Thank you