MQL4 and MetaTrader 4 - page 54

To post a new topic, please log in or register
I've been Googling for a while, but can't turn anything up. Is there a way to retrieve the currently active profile name in code? lastprofile.ini contains, unsurprisingly, the last profile name, not the current one. Thanks
Hi all, I try to insert a variable into the custom indicator that returns to me the closest (lowest) BAR index (for example CCI) where value is greater than 100. example: For last 10 bars CCI have values [0, 50, 50, 20, 50, 99, 103, 102, 101, 0] extern int CCI_period = 14;extern int range= 10;//----...
Hi, i'm having problem to code this indicator, i need to call functions in specific order placed on extern variables, example, if first is 1, second is 2, it should call the 3 functions, functionone first, then function2, and after complete, repeat in a loop, so how can i code it? Thanks for any...
I have a school project (due this Friday) and I'm stuck on an MT4 EA. It takes my SL and TP perfectly - just not my Entry. I made the TA for it first and it prints the RIGHT results to my screen, but it won't work correctly for the EA. I can't figure out why? Anyone here want to take a look. Its a...
Hi, I've been using <Deleted> for sometime now. I think it is good, BUT, I want to backtest a strategy that uses loops in the code, and believe it or not, but you can't write loops using <Deleted> language! So, I started looking for other backtesting software, preferably for free, I found and...
Hi there, I tried and tried to get the open date of the previous year. Can you help me please ? Now, i do it like this but, it's not "pro" datetime  PREV_YEAR_OPEN_DATE=D'2017.01.001 0:00';   datetime PREV_MONTH_OPEN_DATE=iTime(Symbol(),PERIOD_MN1,1);datetime PREV_WEEK_OPEN_DATE=iTime(Symbol()...
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"...
Hi, I am looking for feature of MT4 if there is one such that I will be able to get Alert pop up window manually to review my old Alerts. I know this Alert pop up window I can get by executing Alert() command in EA/Script/CI, but for some reason if I close this window then How do I get it back...
Canadian_Pro
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...
Hello every body, How areyou, I need your helps please .I cant use English so correctly, that's why ,I use thegoogle translation service. I'm sorryif you find some errors. I am abeginner in programming, I just studied the language mql4. I am training to create some functions, I want toprogram a very...
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...
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...
Hello I want to Disable / Enable Expert (Auto Trading) button programmably as if i click on it to enable or disable Expert according to condition. I am searching MQL4 code to do that but i did not find. Any help please.
Please forgive me, I'm relatively new to using the Strategy tester. I'm trying to test an EA I've written to implement a strategy on GBPCAD.  But when I click in the "Symbol" box on the Strategy Tester Settings, I get a drop down list of Symbols, and GBPCAD is not there.  I see no options for adding...
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...
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