MQL4 and MetaTrader 4 - page 477

  Global variables  (4)
Hi: In an indicator I've been developing, I need to save 2 variables on changing chart period for use in the new chart. The code below is truncated from the indicator and uses only the OnInit and OnDeInit events. I stripped and simplified it from the main file so I could troubleshoot it. Basically,...
Hi, I'm new to MQ4 coding. I hit some problem when using customer indicator in my EA. I coded an EA that use an existing indicator. When I run my EA, the indicator is loaded in the chart and I'm able to use the buffer of the indicator. See attached 1. I can see from the log that after EA is loaded...
Hello everyone, I need some help to understand what this runtime error means. I have been trying to work it out, but I am making myself very confused about where the problem starts.    CurrAsk= MarketInfo(Curr,MODE_ASK);   CurrBid= MarketInfo(Curr,MODE_BID);   Ticket=60055216;   Price=0.800133;...
[Deleted]
Hi! I would like to smooth CCI 6 indicator with Smooth Length 5, Smooth Phase 100, like here: extern string TimeFrame           = "current time frame"; extern int    CCIPeriod           = 6; extern int    CCIPrice            = PRICE_TYPICAL; extern double OverSold            = -100; extern double...
  Lot calculation  (8)
It's a pleasant weekend. I'm trying to make the Martin Gail lot calculation. If I lose, I'll double up in the front door twice and return to the initial value if I get profits. However, this will result in error 4051. And I don't know if it's okay to solve 4051 or something else. Wait for your help....
Hi Please help I want the ea to open a buy order when profit exceed 20> I've coded this, see below but the code is unreliable( sometimes it works,sometimes it doesn't).  Any suggestions on how it could be improved? if((OrderSelect(gBuyTicket, SELECT_BY_TICKET)==true) && OrderProfit()>20)BuyA=true;
My broker has just informed its clients that as of Monday: "MT4 charts will show aggregated prices of Bank, Non-Bank, and ECN liquidity on all FX from Monday's market open. It is important to note that all orders will be triggered based on the published Bid/Ask price visible in your Market Watch and
Hello Everyone, Here is the code for the ComboBox (MT4). It work on the indicator but not on Expert advisor ? I wonder why ! I have two questions: 1-How to make a ComboBox in the EA ? 2-How to select an option from the ComboBox's list ? Thank you very much #include <Controls\ComboBox.mqh>...
I'm very new at MQL4 and still learning. What I'd like to do is place several text labels at the top right at a certain position for the purpose of adding notations to a chart. This would be for tracking some of the more "fuzzy" variables in trading which are based upon opinion rather than...
What is the easiest MQL4 tutorial you know? I'm following the one at book.mql4.com, but it's slow going. Any favorites or suggestions?
Hi, I have purchased an indicator, which is of course protected. My question is: is it possible to retrieve the data that appear in the Data Window? I mean for example, that I want to use Value 7 and Value 8. What code should I use? Because, I don't know in which way are named the buffers of the...
  MT4+Raspberry Pi  (3)
Any one running Mt4 on Raspberry pi? Was thinking about giving it a shot. 
  MA Lock  (3)
I have seen EAs that will make an entry when price crosses a trendline. But I wish to find or create an EA with a slightly different slant as below: Meaning: - MA_Lock => Upon candle bar clossing, the EMA/MA has crossed pass a specified price, unlike a MA cross which is temporary and can cross back
Hi experts.   I am trying to create trend line that must not run across the graph. I have some question.How to get value price between the coordinates that can be used in the mql4 rule (Ask>Trend value)? plz give me some advice. thank very much.
Hi all I am trying to draw out the crossing of this indicator, using both green and red arrow, the red arrows seem to be correctly placed, however the green arrows are always misplaced by 2 bars, e.g it is placed on bar 34 when it is supposed to be bar 36. I have attached a print screen to show the...
Hello community, first time poster here!Background: I have mild mql programming experience having programmed a few EAs in the past but recently became interested in creating my own customer indicators.I have a two part question:1) So far I understand that indicators can either overlay the price...
hello guys, i've got a problem with my Metatrader 4 and I hope someone can help me. I discovered this website here just today and was surprised how u can customize ur MT4 so i tried to implement some of the indicators in the market section on this website, but every time i try to download one, the...
Hi good time An indicator Using the icustom method I called inside Exspert During the implementation, The indicator shows the object on the chart Also, when an object is displayed, an alert is given on the chart To show off The moment the object is displayed on the chart Is there any way? Is it
pls i have this difficulty fix fixing this code to stop trading for the day if profit is made my problem is it not working,looks like am missing something .thanks int Startfrom=9; //my day start int Stop_on=20; //my day to end trading double Ppt=10; double AcctBalance = AccountBalance(); double...
Hi All Has anyone experience a chart not updating? I have trades on USD/MXN, and the chart on Meta trader 4 has not been updating since 3.30am AEST 3rd August. Is there a solution to this? I have emailed screenshots to MQL5, though have yet to receive a response. Thanks,  Al
  iLowest  (8)
Hi Everyone! Please point me in the right direction! Trying to get either Lowest_Open or Lowest_Close in Comment, show only the lower of a candle body. The same to the up side Highest_Open or Highest_Close. //+------------------------------------------------------------------+//|...
Hi, does any one know how I can add code into an EA to automatically open trades if there are currently not open trades, I have an ea that will close trades automatically if certain paramters are me buy need them to be replaced as soon as that happens. heeeelp
Hi guys, I wish to read through csv files and then write info directly after the read info.  Now, I know how to read through the CSV file, but I don't know how I can: -move downwards in the csv file -then go back to a specific point -then add data next to the current data Any help would be so much...
Hi, I have a function called CheckOpenOrders() as below. What its supposed to do is to check whether the current Bid price matches any existing orders in a 50-pip window before I open an order. However, somehow it doesn't seem to work and the code ends up opening many orders regardless whether there...
Hello people, Please help me with a solution to this error. I know that is a problem with matching data from a smaller time frame, but i can't find any solution to convert the m1 timeframe to the timeframe that i need. I tried with period_converter, as i read in another topic, but unsuccessfully....
[Deleted]
Hello,  I would appreciate some help. I can program tradestation but I am having difficulties with some aspects of MQL. I would like to be able to send an alert when the weekly high is broken. It would be grand if was able to plot the highs and lows of the week like this: (this is 4H chart)   I...
Hi I have a question ? Is OBJ_BUTTON possible to include in the OBJ_ARROW text? And if so how? Thanks
I'm trying to build a Martin Gail based on these codes. Do you know the location of the writing on the style of writing this type of Martin Gail code? Let me have your answer. if(NewBar() )     {       //if(total<1)                    {      //BUY      if(//conditional expression )         {...
I started getting ERROR 130 when not using SL and TP, there is no prob,  //+------------------------------------------------------------------+void Buy(double lot, int magic){   int tp=NormalizeDouble(Bid+100*Point,Digits);   int sl=NormalizeDouble(Bid-100*Point,Digits);   if(OrderSend(Symbol()...
Hello, I need to be able to extrapolate the current values of trend lines every hour on an EA which runs on the H4 time frame. A separate section of my EA runs at the beginning of each hour and most variables contained within that section update accurately and fine. However "Var1 =...