MQL4 and MetaTrader 4 - page 380

As far as I know long type can be converted to double without problem. long longVar=130365841471008683; double doubleVar=longVar; Print("doubleVar:",doubleVar); The result is: doubleVar:130365841471008690 Why?????????? Please help!
I can't isolate the reason why the values that a custom indicator that is called from my EA gives when I try to backtest the EA, are different from the values this indicator shows when I attach it to a chart. I have tried to find info about the internal processes of the tester, but I didn't have...
I have the following problem to solve. On computer A, there is an EA that updates several variables several times a day. On computer B there is EA, which must read these values ​​when they change. Both computers are in different locations and communication between them can only take place via the...
I have an indicator shown in a separate window and I want to place a text label in the window. The code I have is: void CreateTradeLabel() { string name = "tradelabel" ; int chart_ID = 0 ; if ( ObjectFind ( 0 ,name) != 0 ) { if (! ObjectCreate (chart_ID,name, OBJ_LABEL , 1 , 0 , 0 )) {
  Coding Error  (4)
Please , not sure where the error is on the code....... Thank you void OpenBuyStop()  {     //------   while(true)   {    ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,price,0,0,price+TakeProfit1*Point,"OpenBuyStop", MagicNumber3,expiration,clrGreenYellow);     if(ticket<0)Print("Error= "...
How to code in MQL4 to produce a graphic like the image below?
Hi, As far as I know the close price for the current, not yet completed bar is the last price. Therefore the close price is constantly changing with each tick. I can see this happen when simulating indicators of other people. But of course not my indicator. It looks like it immediately jumps to the...
Hi call, is there a way to check the minimum distance between market level and pending price order requested from the broker? Thank you
  Time constraint  (3)
How can I make sure that; Advisor (robot)should open position only if 5 min passed after last position had opened. Thanks.
So I have the exact criteria to open a buy market order and sell stop pending order,I also have a sell market order and stop buy pending order that has the exact same criteria so that either one hedges but the sells stop isnt working and the code is perfect. So i started to tinker with the criteria...
Hi, Is there a way to communicate between 2 EAs? I mean: an EA works in H4 and at the same time another EA works in DAILY Can the first EA retrieve data from the second and how? Example : the H4 EA needs to know if the DAILY candle is red or green Thanks
Hi, I have connected a DDE from MT4 to Excel and now I want to use that live updated price to multiply it with an other value but it doesn't work, it just says #VALUE!, how can you solve this? Best regards
Hello Everyone , Recently I have found out an average price indicator . The indicator is accessible from the following link & works fine on MT4. But I want to develop an EA with it on an eabuilder. This indicator doesn't work with eabuilder  due to absence of buffer . https://www.mql5...
  Counting Candles  (13   1 2)
Hi friends, I want to calculate the candle number after and related to specific time period on current chart. For example on H1 cahrt i want to numerize the candle after 00:00 Oclock (After every day opening). I have already make an indicator Using time formula and Ibarshift - Both of them are...
Im facing this error when I try to retrieve the oldest ticket in my current pool of trades using the functions below, int EarliestOpenSellTicket(){    datetime EarliestSellTime  = TimeCurrent();        //initialize it to the current server time. You will have no orders newer than that...
Guys i need help with the following... I am trying to open a buy order 2 or 3 bars after fast ma crosses slow ma and when the rsi is greater than 50 as well as when both stochastic lines are greater than 50. A sell order for the opposite. The code below is an attempt at a buy order for the 1 minute...
  REQ HA Offline Chart  (228   1 2 3 4 5 ... 22 23)
Hi, it is possible to create and indicator like renko using the Heiken Ashi Bars? In this way we can attach to this offline chart all the indicator with different information respect the standard chart. Waiting your reply, Regards
Hi All, I'm trying to use the functions CopyTicks and CopyTicksRange in my MQL4 code but get the error "function not defined" CopyTicks: https://www.mql5.com/en/docs/series/copyticks CopyTicksRange: https://www.mql5.com/en/docs/series/copyticksrange It seems that these function doesn't available in...
[Deleted]
Hi, I have a problem, my broker use commissions, when I use in my EA trail stop it close the trade without profit finaly because it from Open price to close price standpoint its ok  but than the commission is not included and the net trade is loss. how can I tell the EA only if net pips is more than...
Hello, I develop a simple little strategy that consists of opening 6 orders at a time from different pairs, and I want that when two pairs with the same magic number reach a certain profit on money together they close without touching the 4 remaining orders, after closing both first i also want them...
I can mark the minimum and maximum of the month, week and days, how do I mark the specific day that this event happened ? I need to put in a label
Hello all! I am trying to add an image to the chart using ResourceCreate, but for some reason I am getting error 5002: "Wrong file name". ResourceCreate("ChartImage","\\Images\\image.png") I have also tried this code, with the same error: ResourceCreate("ChartImage","\\Files\\image.png") I've also...
[Deleted]
Hi, I would like to ask if someone has already tried to accurately check if a certain trade is closed by stoploss or takeprofit. I have a function that deals with this but its not that accurate because it checks the orderhistory then checks the comment if it has "tp" or "sl" on it but the problem...
Hi All, My MT4 installation has been working just fine for some time. My "New Chart" drop-down menu showed 6 options: Forex-1 Forex-2 Forex-3 Metals Indices 1 Indices 2 Now "Forex-1" has just disappeared leaving the remaining 5 options.  Does anyone know the MT4 internals well enough to tell me...
Hi all, i made this ea which based on FANN neuro, i had created the network file and trained it with FANN Tool then i tried to create the neuro network by calling function: ann = f2M_create_from_file("Close.net");  and every time i got the same error (FANN_DOUBLE_ERROR) so always the output...
Hi, I am trying to understand the risk/reward ratio over a series of trades. To keep things simple, using my custom indicator, I might get 50 signals/trades and each trade uses a stop loss of 10 pips.  25 of the trades make some kind of pip profit level, say 30 pips each. 25 of the trades hit...
[Deleted]
Hi all, I'm new to MQL and am having trouble coding this. I put: (PRICE_CLOSE-PRICE_LOW)/(PRICE_HIGH-PRICE_LOW)[1]>0.8 in my opening order criteria but it is giving me an array required error. What is an easy way to plug this into an open or close criteria?
Hello, My trade notifications are not going through, any time there is a trade or even if I test the push notification, I get the error below. Any ideas why it might not be working?
void hedger(){   int buy_trades_number = _get_number_of_trades(OP_BUY);   int sell_trades_number = _get_number_of_trades(OP_SELL);   int numberofhedgedbuys = _get_number_of_trades_hedge_buy(OP_BUY);   int numberofhedgedsells = _get_number_of_trades_hedge_sell(OP_SELL);   for(int n=OrdersTotal()-1;...
Dear forum, I'm trying to get the previous two, fixed ZigZag values -- I've tried the method found here, but it doesn't seem to work. What I have now is this:    for(int k = 1; k < Bars; k++){   // Get most recent ZigZag      if(iCustom(NULL, 0, "ZigZag", Depth, 5, 3, k) > 0){         ZigZag =...