MQL4 and MetaTrader 4 - page 556

To post a new topic, please log in or register
Hi Guys I'm interested in an AE that can quickly calculate what my position size should be. So for example if I'm trading the eurusd and my account balance is 10k and I want to very quickly find out what 2.5% would equal in lot size. I was thinking something like a left click and hold or something...
Hi! I need to get profit in point of last closed position.   This is the code, but something wrong. Please help. Thank you.    double GetProfitLastClosePosInPoint(string sy="", int op=-1, int mn=-1) {  double p;  int      i, k=OrdersHistoryTotal(), pr=0;   if (sy=="0") sy=Symbol();  for (i=0; i<k;...
Can anyone tell me an easy way of calculating the percentage of days up vs days down over a given period.  So 20 day look back, 16 days were up days = 80%.  Not exactly rockent science i know but  I don't want to do it in Excel.  Do I need a custom indicator?  Or can I put it directly into a EA?
I need a simple robot that simultaneously opens a buy and sell position, with a stop loss of 1 pip, and a take profit of X number of pips. It should open multiple hedging positions on the same chart, with various expanded take-profit margins, but always a stop-loss of 1 pip, to eliminate all basic...
Hello, I am using demo version of MT4/5. and I am intersted to open an A/C with them. I live at Ahmedabad, Gujrat, India. So how can I open an A/C to get an online charts of NSE stocks and F&O? and what are the chrges? Thanks in advance
suppose I want to enter a trade when one condition just occured and another occured in the last 4 bars. how do I code that? for example, if I want to buy if stochastic crosses above 20, and RSI crossed 30 in the last 3 bars, do I need to define RSI for the last 3 bars and then code that? can I use a...
After running a visual test of an EA, is there a way you can save the chart so you can open and use it again? and analyze trades?
I try and try, but I can't do. I know is the logic. please help. Thanks for the help.      /+------------------------------------------------------------------+ //|                                                    i-HighLow.mq4 | //|                                          Copyright © 2007, RickD...
Hi,  Can you help me? Upper Shadow and Lower Shadow is missing (See images). I installed MT4 in HTC One (Android OS, v4.1.2 (Jelly Bean)).   How to display the Upper/Lower Shadow on the Candle Stick Graph? What is Upper Shadow and Lower Shadow, please see image below  
Hello, I have a question if I have something like this:if (condition){Bool x=true; for (int i = (total-1); i >= 0; i --) {if ( OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) if(OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) if...
dear friends I downloaded the EA Snowie some days ago but when I compile it there is an alert message saying: function "convertBoolToStr" is not referenced and will be removed from exp-file. so i can not add it on my platform's charts. please i will be glad to hear from the programmer of this EA...
anybody know how to get historical data? I saw "FileOpenHistory" function but no function on how to actually read the data. any ideas? Thanks Eli
MT4 used to have a mini terminal that allowed you to enter a position with a SL and TP at one click though i dont have this terminal any more Can anyone help me with this? thanks Dan 
Hello Smart MQL coders, I need some help with this News Breakout EA. Just started learning mql days ago. My idea for this EA is to create both a pending sell and pending buy order at a distance from the price at a certain news release time. I am having problem coding to close out other opposite...
Here's the correct one of phy code in start() function int start()  {   if(oldTime != Time[0] )      {      // first tick of new bar found      // do something useful      oldTime = Time[0];      }   return(0);   } I'm trying to get and ea to open an order at the start of each bar, and no other time...
New article MQL5 Cookbook: Developing a Framework for a Trading System Based on the Triple Screen Strategy is published at mql5.com: In this article, we will develop a framework for a trading system based on the Triple Screen strategy in MQL5. The Expert Advisor will not be developed from scratch....
for(i=0;i<=limit;i++)       {          double xy=MathPow(bar/2,2);           count[i]=0;          ave[i]=0;          chazhi[i]=0;          countpingjuncang[i]=0;                                              for(x=i;x<=i+10;x++)                     {...
//+------------------------------------------------------------------+//|                                               台湾鸟-波动率.mq4 |//|                        Copyright 2012, MetaQuotes Software Corp. |//|                                        http://www.metaquotes.net...
Hi  I am creating a buffer of 20 elements to store profit for last 20 ticks .. want to calculate a weighted average from this buffer.  However my buffer variable ProfitBuffer[i] which is declared a global seems not to hold any value. Any ideas why ?  Cheers // Gobal declaration double ProfitBuffer...
  EA Coding (1)
How can I set the stop loss at certain level of loss (5) and  setting maximum lot size? 
I wrote an article and submitted it for publishing on this MT4 site over six months ago. Since that time is has just sat there with the "ready for publishing" sign, but no messages or responses from admin. I think that it is the admin which is responsible for finally publishing it, and there is...
How do I make an EA give comments so that I know how the trade was closed? (like if it was from trading condition 1, 2, 3, etc, which you coded.)
Hi everyone,   I'm new here and I would appreciate if you could help me with these 3 questions: 1. I'm developing a trading strategy on FOREX markets which must close all open trades and cancel all existing orders at about 0:00. The easy way to do this is with "if" statement (if timeCurrent = 0:00...
Does anyone know the GMT offset for back testing in Alpari UK? Also, does anyone know if the metaquotes data timestamp is on GMT or has an offset?
Hi, I have created EA thatshould be trading based on the below rules. However something is wrong and Idon’t know what. 1. Buy - Candle Close(2 shift) < Adaptive Gann High-Low activator && Candle Close (1shift) > Adaptive Gann High-Low activator 2. Sell - Candle Close(2 shift) > Adaptive Gann...
i use the EA expert to backtest my EA. But there is some error with the part of code below. the journal said "ticket for OrderModify function must ba an integer". Does anyone know where the error is? double Ticket;  double TrailingStoploss;  double highest;  double lowest;...
Hello, I have decided to start learning MQL4 and I have created my first Expert Advisor. I just wonder if you can give me any feedback, comments if my approach is reasonable or if there are no unnoticed glitches in the code I have created. Anyway, I would appreciate comments :). extern double Lots =...
Just downloading and installing Metatrader4 by itself crashes my computer (Windows 7). The installation green bar nearly completes its journey from left to right but stops with less than 5% to go and the mouse is frozen.  Not even control alt delete will work.  I must shut down manually. This...
hi.. this is my first thread in this great forum.... i spent two weeks reading threads and trying experts, indicators,scripts...   i want to trade formedium to long term...most of demo accounts offered by companies expired after month...altrade  demo stay for 3 months before expiry but lastly they...
Hi all, I want to discuss about writing a script that could inverse a currency pair. I Got the below script from this topic: https://forum.mql4.com/35535 and i make some changes to get the real data from market. But when you open the offline chart, the output of this script does not update in real...