MQL4 and MetaTrader 4 - page 37

To post a new topic, please log in or register
  How to return new SL (12   1 2)
Hello! In an EA, I modify the SL and then I want to return the new stop loss as the following: current_SL = OrderStopLoss(); But I got the original SL (before modification) into the current_SL How can return the new OrderStopLoss() into the current_SL Thanks. PS: I defined the current_SL as double...
Hello, I am pretty new to mt4 and have limited understanding of what is possible code-wise, so if I ask about some impossible stuffs then simply say "no can do.". 1/ Would it be possible to color tabs in mt4  based on a simple yes/no condition ? ( the tabs I mean currency listing letters that are...
Hi LTF was 60m and then it changed to rubbish value: https://i.imgur.com/bqt4Vjj.png Also when I copy all to excel, some values are corrupted: How to fix it? https://i.imgur.com/1Q9vcBQ.png
  Why does this not work? :( (23   1 2 3)
void OnTick()  {   datetime candletime=0;   datetime currenttime=0;   currenttime=Time[0];   double K_line=iStochastic(NULL,0,20,3,5,2,0,MODE_MAIN,1);   double D_line=iStochastic(NULL,0,20,3,5,2,0,MODE_SIGNAL,1);   double pK_line=iStochastic(NULL,0,20,3,5,2,0,MODE_MAIN,2);   double...
<I would like to test from the Candle which is assigned randomly.> 1. However when I open the HISTORY from the TOOL of FX, it shows like below, ASKING : ***IS THERE ANY METHOD TO SEE THIS LETTER TO BE CORRECT LETTERS? (ANSI and UTF-8 is same result. Do I need to download any letters?) 2. If you tell...
Hello, I place an Order, but I get the Wrong Order open time. Can someone tell me, where the error is? My code: if( OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,(Bid-0.0003),NULL,0,0,Red))               {               Print("SELL order opened : ",OrderOpenTime());               delTimeOpen( cnt...
Hello, according to the documentation (https://docs.mql4.com/constants/io_constants/messbconstants) "The main flags of the MessageBox() function define contents and behavior of the dialog window. This value can be a combination of the following flag groups:" But when I try this: int PlaceTrade =...
Hi folks, how are you? I have a question, can I import external charts to analyze in mt4 platform?
I do not know how the candling system in MT4 works. I am under the assumption that they are "japanese" candle sticks. They Have Open, High, Low, Close But They Are discontinuous. Like This:   Even on something like a 5M graph... Why Is This? This Makes Absolutely No Sense To Me. I am Assuming That a...
Hello, All the sudden my windows computer doesn't know how open MetaTrader. When I click a link in the market, I get a box asking me to select how to open mql4buy. Does anyone know how to set the correct association, so that it will work again? Thanks in advance. All the best, Fred Langemark
Help me I'm writing code. Create a button to close all orders and Close only Profit order  Button  close all button is working but  close only profit not working. void OnChartEvent(const int id,                   const long &lparam,                   const double &dparam,                   const...
I create an Appdialog from #include <Controls/Dialog.mqh> and I need to use Run function to run my app dialog on Strategy Tester mode. How can I do that? Where should I put myAppDialog.Run();  to run my appdialog on Tester mode?
Hello, I have the following code... maxLots = AccountFreeMargin() / MarketInfo(Symbol(),MODE_MARGINREQUIRED);lotStep = MarketInfo(Symbol(), MODE_LOTSTEP);maxLots = floor(((maxLots / lotStep) * lotStep) * 100) / 100;maxLots = NormalizeDouble(maxLots, 2); With $1,000 in Free Margin on an account with...
Hi all, Newbie in forex. What does the volume indicator in MT4 mean? I saw something like 4, 20, 100 etc. Does it mean a full 100,000 units contract? For instance, 4 volume EUR/USD means 400,000 units of EUR? Thanks in advance. Hydrom
I'm very new to scripting in Mql4, but I want to make a script that takes the alert message from my indicator and sets multiple orders with the same stop and different take-profits But I keep getting a 129 error and I can't figure out why. Here is the string from my indicator GBPUSD BUY: 4.32 @ 1...
Hi, MT4- How can I have my Indicator analyze "X" # of candles before starting? If I dont do that, it may take many days/week before my EA has enough data to start dealing. Thanks
I have somehow managed to shrink the toolbar to just the left side of the page... how do I correct this so that the toolbar fills all the way across the terminal landscape wise?
Hi, Can any one please advise on my coding where I am wrong, basically I want to check 10 next candles after 2 moving averages cross but I am not able to run the counter loop. Please find attached my coding. Many thanks. Aryan
Hi I wrote this code after reading online, not sure how to do the "JPY" part of the code, please help and correct me if there is something wrong with it. Thanks // PIP value for standard lot 100,000 unitsdouble getPipValue(){  string symbol = Symbol();  int usd = StringFind(symbol, "USD");  int jpy...
HI all of you In about last two weeks i´ve discovered the power of MetaEditor . Ive heared about tons of expert advicors and mostly all of them are profitable ( ! hope so :P ! ). During these two weeks ive been trying to code my own expert advisor but i´ve realized that im not able to understand...
This code failed to return the number 6 which is how many char in a forex symbol, any idea how to fix it? Thanks   string symbolArr[];  int k = StringSplit(Symbol(), "", symbolArr);  Print("k is: " + k); // prints "1" but "6" is expected.
  Will Code EA for Free (40   1 2 3 4)
Hi all. I am new to this forum, but have been around trading and programming for over five years. I love both trading and programming. I was a trader first and learned to code to build my own trading systems. I have programmed in MQL4, Excel/VBA, C#.NET, and a little C++ I am looking to offer up...
Can someone teach me how to solve it to me please?? it is "simple" I created this code so you guys can test it. I just want to know why my OnChartEvent() stops working when i drag the "Box". if you guys check the buttons, you can notice that they stop doing their OnChartEvent() function. int...
Hi, does someone know how to import tick data in MT4 to make a 99.9% backtest without using a commercial software? I tried with Tickstory free but it doesn't work with build above 545...I struggled all day to find a solution but without success, so I decided to open a topic, this could also help...
Hi...i am new in the system... do anyone knows about KPL swing (breakout trading system)...can anyone convert this afl into mt4... //---- heikin ashi HaClose = (O+H+L+C)/4; HaOpen = AMA( Ref( HaClose, -1 ), .40); HaHigh = Max( H, Max( HaClose, HaOpen ) ); HaLow = Min( L, Min( HaClose, HaOpen ) );...
Hello guys. I need help in coding my EA, so it can avoid news. I tried ti do it myself and what happens, is that the EA opens trades (inside news time), and closes them immediately. Here is the code: Externs: extern bool AvoidNews=true;extern int MinimumImpact=1;extern int...
Hy guys... There is a way to initialize an external datetime variable with the current time ?   I'm try something like this:  extern datetime fundamental = TimeCurrent();   But returns me the following error: 'TimeCurrent' - constant expected   I need to show the current time, not  1790.01.01 00:00
I have a back testing program that only accepts indicators as DLL's. Does anyone know if it's possible to convert an MQ4 indicator to a DLL? If so, could you please tell me what I need to do in order to convert it? Thanks
Hi, I am building a mql4 code where I'm trying to open EA property dialogue of a particular chart and click allowlivetrading button in a common tab. Could someone show me a specific code to do this ? I'm a pretty much newbie mql4 builder ! (Also not very familiar with Win32API either.)
Hi, I would like to have a line appear on my chart that would match a variable value so I could follow the EA visually. (MT4 please) similar to a Trailing Stop mouvement. I would also like to change the color of some lines in comments if possible. Any help or advice would be appreciated. Thanks.