MQL4 and MetaTrader 4 - page 261

Hello friends, I´m working in my EA estrategy, if someone has these indicators for MTF. I will be enormously grateful
Hello all, Can anyone pls help me to check out where is the problem with my EA? It open some trade where the condition set is not met.Below is the attached file of my code Appreciate your help. Thank, Newbie
Hi guys, In my project I'm using an OBJ_RECTANGLE_LABEL object to draw a fixed position rectangle. It works fine, but I have a problem. When I open and close positions with my expert advisor, these methods draw arrows and lines on the chart (that's normal). When those objects get my fixed position...
I'm able to run my script just fine in the debugger, and I figured out how to change the time period and pair because the default was the EURUSD 1H.  Everything works fine in the debugger, but it won't execute in my demo account. //+------------------------------------------------------------------+...
How to put my custom volume indicator on main chart? Is there any built-in function to do this?  I read the documentation but i didn't find any explanation and example.
Hi First of all, if you have already replied to similar questions, then please accept my apoligies, but then it would be really helpful, if you could send a link to your previous reply, as I've not been able to find any similar questions on your site. I just upgraded to MT4 build 646, where after I...
Dear experts, Would you please advise on how I could improve the execution accuracy of the following orders: Problem: Some of the orders are left unfilled, i.e. "The 2" position hits its stop-loss at the level of "The 4" but "The 4" positions are not opening and sometimes "The 2" closes but "The 4"...
[Deleted]
MT4 giving me an error 130. Here is the code:  ticket_order = MarketOrderSend(Symbol(), OP_BUYSTOP, Lot(lot_size), ND(Ask+Distance*MyPoint), 10*int(MyPoint/Point()), ND(Bid-StopLoss*MyPoint+Distance*MyPoint), It places a BuyStop oder but without Stop Loss and Take Profit (error 130). What am I...
Hi all, As I use the "Open prices only ...) to backtest my EA, it ends just in a second and there is no any result. But if I use the other two 'Every Tick' and 'Control points ...', it takes much longer and I can see the results. Why?
Hi, is there any special syntax to override parent functions? or is not possible if they are not "virtual"? Thanks !!
Hi there, I need you to know if it's possible to force a subwindow pixel height (and not percent height). I see this documentation, but, there is no example to do what I want to. https://docs.mql4.com/chart_operations/chartgetinteger Can someone help me please ? Regards.
[HELP] "CHARTEVENT_OBJECT_CLICK" - OBJPROP_STATE Is Always Returning 0 (False) - I used OBJ_LABEL to Create Wingdings For Fixed Position.. Bug? I clicked the wingdings but ObjectGetInteger(0, "show_buff_obj"+0, OBJPROP_STATE); is returning Boolean value is 0 (false).. It should be true when clicked...
Hello there, I am creating a  buttons panel, so far is so god, but whent i am trying to aatach zoom function to my zoom buttons, I get this bug : The timeframe buttons do not released, and i cannot erase a template, when i want to save it. Here is my code (What is wrong please ? ) : long...
I have a buffer array named JPY_Band[] and another named CHF_Band[]. I want to subtract the value in the first index from the value in the first index of the other. Something like this double result = JPY_Band[1] - CHF_Band[1] this is not giving me what I expect. In fact it's not returning anything....
Hi, everyone. I'm wondering if someone can help me on this. Suppose I need to open a 112 lot buy trade while the broker only allows max 50 lots in a single trade. So I need to break up into 3 trades 50 lot, 50 lot and 12 lots. the following code does not work and I don't know why. In back test it...
To say that I am puzzled is an understatement. I removed all the Buy Sell and Exit conditions from this EA, Ran the Strategy Tester and it still makes trades. It seemed that no matter what trading conditions I entered weird trades would take place, beginning and ending at random.  Oblivious to the...
  A little confused  (10)
Hello everyone, I don't understand what I have done to course error  - constant expression required. Please enlighten me double  MAW= iMA(Security,Timeframe,Preiod,MA_Shift,MODE_SMMA,PRICE_WEIGHTED, SHIFT);double  MAT= iMA(Security,Timeframe,Preiod,MA_Shift,MODE_SMMA,PRICE_TYPICAL...
Hi, I am just programming an EA and I have been reading the documentation I found: https://docs.mql4.com/files/fileopen As far I know (I am not an experienced programmer), FILE_SHARE_WRITE (or share read) must be used when a file is accessed from multiple programs, right? My EA automatically exports...
  OrderClose  (2)
Can any one explain? the OrderSelect, OrderType and OrderClose functions am I using correctly ?  I want to close a trade when the new high comes. if(OrdersTotal()>0          && OrderSelect(ticketBuy,0,MODE_TRADES==true)          && OrderType()==0)       {         //bool...
  Mq4 you tube coding lessons  (19   1 2)
Check here this person giving coding lessons on mt 4, 30 lessons in all, from what I've seen so far he is a very good teacher.This will get you to lesson #29, but once there you will see the rest
Hi. I would like to ask the following: 1. Init - does something that you want the EA to do as it is loaded in the chart. If that is so, why does this not prompt the Hello world upon load of the EA? int OnInit()  {   return(INIT_SUCCEEDED);   Print("Hello World");     } - Why do the following errors...
How to Put Object VLINE Under Candle To See the Upper/Lower Shadow of the Candlestick? I want to make Vertical Line under the candle to see clearly the shadow/tail of candles or Is there any way to avoid hitting the candlestick?  There should be one—and preferably only one—obvious way to do it. (Zen...
Please can anyone point out what is wrong in this part of code below, it is showing "array out of range" and pointing that the error is on this line: datetime time = Time[0]; datetime getLastTradeTime(int type){    datetime time = Time[0];    for(int cnt = OrdersTotal()-1...
  ADD LOT Problem  (4)
Hi Guys, i`m struggling upon something -  its an add lot function. Can you help me make it start only one additional order per main order? Mine starts like a million additional orders. I`d really appreciate the help. Best Regards
Hi, I'm a bit confused with the "lots" unit, is there any way to get the total amount in USD or current currency for some order position? I know we can get the OrderOpenPrice() and OrderLots() but I don't know how to use it. For example, if OrderOpenPrice is $100 and OrderLots is 0.1, what is total...
Hi guys! I've already read topics in this forum about this error and implemented my code. However, I can't understand why error 1 is still presented, even though occasionally. Here is my code (I use two ticket: "0" to identify buystop and "1" to sellstop) void TrailingPendingOrder()   {...
i downloaded an EA mentioned in subject. it has 2 issues... 1) it does close a trade at reaching the given pips, either in loss or profit. means it has only 1 option for profit and loss. we can't give let's say i want it to close if reach at 30 pips profit or  20 pips loss. it ask only one number...
  Math Question  (4)
OK I need to know the difference between two numbers. This is easy when I need to know the difference by subtracting the smaller number from the larger number however there are many cases where I need to know the difference of the numbers when I need to subtract the smaller number from the larger
Hello, i just want to code a rectangle which should be moveable, when dragged. Unfortunately, i get no CHARTEVENT_OBJECT_DRAG called. Is there any setting in MetaTrader 5 or a "ChartSetInteger" to be called in order to get it work? I played around with zorder, from 0 to 2, but no help. The property...
This code wont paint arrow in real time. I know there is one loop needed for checking current running candle but firstly I don't understand what this "void clearmarks" function does? And can I write a new loop into "void CheckNPB" ? double CalRange(int bar_num, bool verify=false){   int counter,...