MQL4 and MetaTrader 4 - page 146

To post a new topic, please log in or register
Hi guys  I wish to have the MT4 to have the prices update when the market is closed (weekend) so I can test EAs immediately while I am coding them without backtest. The data prices obviously are random or past data. Does anyone know of  way to do that  or a plugin that allows that?    Thank you
Hi,  I am new to MQL4, I haven't had a problem coding lotsizes based on a fixed amount of pips but cannot seem to make it work where I am calculating the lots size base on entry and stoploss levels. Please advise... Code is below...  void EnterTrade(int TypeOfTrade){    err=0;    double Equity =...
peterhw
  Invalid stops error 130 (17   1 2)
I have been using XM brokers and appear to get Invalid Stops occurring more often tyhan elsewhere but in any event don't quite understand what factors can lead to this error  I read the following with WHRoeder's comments - interesting but don't don't think they apply to my circumstances  https://www...
Strange Discovery; I need Help! I discover today as I was trading using my hedging strategy that I could not place a pending order within my recovery gap again as the platform kept on saying invalid SL/TP. I sense there was a little volatility in the market then but even for like 1hrs after then,...
hi, i am writing a custom indicator, i need it to sum the closing price based on specific time for x times  for example, sum all the closing price happened at 1100 pm only for last 10 days on a hourly chart(because it may miscalculate on other time frame) assume today is jan 30, the indicator will...
Perhaps a large portion of the negative aspects of the NFA hedge and FIFO rules could be mitigated with Back Office record keeping. (or somewhat mitigated with a good dashboard and a reliable VPS. There would not need to be any creative bookkeeping just strict protocols for interpreting orders. If...
Hi guys. I am trying to write an EA which will auto download a file from the internet, then read data from that file and then execute trade using those data. but i encounter problem with downloading file. the file i download got a bigger size compare to the one on the server. If I run this code on...
Another proof why an EA has most of times completely different results on live. Imagine that bug on a live account with real money, easy way to lose your money thinking that it is because a bad robot. No always! Sometimes may be because of a platform bug. On tester, orders 3 & 4 close with pips gain...
Hello! I have a problem. When a use hash.mqh in EA then I have a bug I attached my EA but dont attached dll file. log file: --- 2017.01.12 19:37:37.572 hashtest USDCHF,H1: invalid pointer access in 'hash.mqh' (631,24) 2017.01.12 19:37:36.249 hashtest USDCHF,H1: checkHash:true 2017.01.12 19:37:36...
Hey Guys its kinda strange, and i don´t get the problem solved. Maybe some stupid failure pls help ;) a bit German included but not important ^-^ This works perfectly. void drawVerticalLine(double Rastercounter, int Teilnehmer) {     string  lineName   = "asdf";       if(ObjectCreate(0,lineName,...
Hi everyone! I'm trying to merge some indicators using iCustom. An indicator which I have problem with is TrendChannel.mq4   Parts of the code are these:  extern int  degree = 1; extern double kstd = 2.0; extern int  bars = 48; extern int  shift = 0; extern int  AlertPipRange = 5; extern string...
Hi guys   As I started Meta Trader 4 this morning, I'm suddenly not able to select periods and tools for a chart. These buttons are all greyed out.   This picture explains what I mean:     I also noticed that I have no connection to the broker server. Maybe this has something to do with it?   Does...
Ok this EA has been running for about 6 months. Just thought I would check a funny sell order, and this is what I found. The Trace line printed 3 different time event series on the same line!  1. My trace showed IMA moving averages of USDJPY  showing at yellow line on chart.(115.994 ma3)  (115.966...
  script help (1)
I found this script on the forum for limiting open orders but I put it into metaeditor and it givevs me errors when i try to compile it. and would this work with an ea i have on a char like eur usd or usd jpy?   #define MAX_ORDERS 5       ...    if(OrdersTotal()>=MAX_ORDERS)      {       // Don't...
I get the 130 error from time to time and i cannot figure out why this happens. I place two pending trades - a Buy stop and a Sell stop. The one will get accepted and the other is rejected with an error 130 message. I use ThinkForex which have no minimum StopLevel. They are a STP broker. My Stop...
  Sunday night price bars (16   1 2)
I trade daily bars, but the Sunday night bars are useless to me, and they skew the price patterns I'm looking for.  Is there any way to either: a) delete these bars from the chart, or b) blend the Sunday prices into the Monday bars (ie. make the 2 bars become one), or c) identify a Sunday bar in my...
Hi, Am I correct, that there is no function or system-variable that tells a class whether it is called by an indicator, expert or a script?
Hi,   1st, sorry my english.   I have crossing moving avarage robot, but if it has an open order, dont open another order until have closed the previous.     This is the problem? Thank you   
I have never considered this before. I just wondered if anybody actually knows the order of an iCustom() call in an EA. Is the iCustom executed before the the code in OnTick that uses the value? I ask this because I am currently working on a project where the iCustom call is only executed on a new...
Please, what function opens the scripts to EA?      
Hello. You know kindly tell me, how can I create, the "v_line", to use as a separator period (say monthly), so I remove the default ones of mt4. thanks  
Hi, I'm attempting to implement a parabolic SAR based strategy using a source created using EA Builder. When I compile the code, the error shows:  '{' - function definition unexpected The error relates to the item highlighted below:    {Strategy: Parabolic change - 1 day   Created with EABuilder...
Hello Friends, i'm a beginner for mql coding, i tried too much but i could'nt write an EA correctly that i thought, maybe somebody help me about this, steps are as following; 1- EA will open 1 BUYSTOP and 1 SELLSTOP using highest and lowest of last 3 bars, OP_BUYSTOP at Highest[last 3 bars]+5 pips...
Hi guys, i can't make updating my pending orders on every price changing, moving following price until 3 sec before news relaese (yeah another news trading ea). I wrote an ordermodify but seems to work just once. i saw many ea on youtube that create moving pending order until news relaese, but i...
I would like both EAs to have the ability to trade ALL cross-connected instruments regardless of prefix or postfix or whatever chart the EA is operating on, this will save me having multiple charts open with multiple EAs running on both MT4 terminals and reduce CPU/RAM lag. Hope you guys can help.
peterhw
  2 - Common Error (11   1 2)
I have code which has worked for a while and for some reason I am now getting the above error the code is   RefreshRates();         string st_50020=MyDT+"50020 OBS ASK  = "+DoubleToString(MarketInfo(My_OrderSymbol,MODE_ASK),5)+       " BID  = "+DoubleToString(MarketInfo(My_OrderSymbol,MODE_BID),5)+"...
Hello,    Can an EA know my MT4 account password by accessing the .DLL file? I mean when I allow to import the .DLL file included with the expert advisor.    Thanks, 
If you use an Expert does it automatically liquidate you position if you end it? Or do you keep the last position until you close them manually? EX: If the Expert Buy 1 lot of USDJPY and you want to end the Expert does it automatically sell any open positions it created?
Goodmorning everyone. I'd be trying to finish my indicator, but I can not understand, what are the functions, in order to create the labels, similar to those that are generated automatically when you open a trade (those on the left of the graph, which are anchored. If moves forward, backward graph,...
I have a problem... I declared an array outside any function, so, the scope of this array is global. Execute the EA and I save and load data from this array on a pair, for example EURUSD without problems but, the problem is when I execute the same Expert Advisor on 2 or more pairs, the data is...