MQL4 and MetaTrader 4 - page 243

To post a new topic, please log in or register
i dont know why but it always return zero, help double test_array[];int i;i=1;int init(){return (0);}int start(){test_array[i]=3.2;alert("value = "+ test_array[i]);return (0);}int deinit{return (0);}
I have tried IndicatorCounted and Bars, but its always return the same value. I need to count ticks for arrays. 
Hi there, I'm trying to calculate MA of Z-score. Z-Score calculation works fine but I can't get any value out of iMa. Any suggestions? Cheers! double GetZ(int bar)   {     double z_score[];     //Calculate Z-score  z_score[bar] = ((iClose(NULL, PERIOD_CURRENT, bar) -              iMA(NULL...
I just want to understand why Close[0] is always less than BID price by 0.5 pips?? Am on FXCM demo account. Does this difference exists even in real time trading accounts     -Thanks 
Hello guys im coding my first EA and im with some problems with the stop loss.  So, in the 1 minute time frame it wroked perfectly, but i tryed to test the EA in higher time frames than i got an error about unmatched data, i downloaded from de history center data from the pairs and it runs the EA ok...
Dear sir To Refer Future Bars in Amirbroker we can use Ref( ARRAY, period ) The formula "ref( CLOSE, -14 )" returns the closing price 14 periods ago. Thus, you could write the 14-day price rate-of-change (expressed in points) as "C - ref( C, -14 )." The formula "ref( C, 12 )"...
Hi, i have been trying to figure out why my trailing would not work. When a trade is executed, i would like to change the stoploss accordingly like a trailing stop. I used an OrderModify to modify the stoploss as per seen below but always ended up in an error. After some testing, i suspect that my...
I have searched google and the MQL's but I cant find any examples on how to change the colors of the axis, scale, etc. I would like to cahnge the according what order is open. red for sell,green for buy,blue for no orders.
Hello Forum, So I recently started to think about recovery safeguards for this EA, in the event of server crash, power outage, the likes. One hint I found somewhere was to use... Global Variables of the Terminal as more permanent storage for some of items that would need recovery - mainly doubles,...
Hi All, I have an EA that opens trade at a specified time. It is working well on currencies. However I have a problem with CFDs. Curious is that if I use Strategy Tester, EA works perfectly. But when I set EA on my demo account to forward test it, it is not opening trades. No errors and no warnings...
I have written an EA that is quite sensitive to small price changes of 2 pips and more. When testing on historical data in the Strategy Tester it gives beautiful results, but when doing forward testing it is very disappointing and not profitable. When I retest the EA on the live data used for...
CUSIV01.MT4  compiling error called out. "Improper enumerator error cannot be used"   Can this be fixed? I am quite new to MT4.  But I like the platform very much. This particular indicator was working on my charts for a day. It a good one. Would like to continue using it.   Thank you for your...
So i have been thinking many days on this Problem and don't know how to fix it, maybe someone have Idee for algorithm, i will be very thankful Basically it's a Grid system, at Start it will open 2 level above with predefine Increment and 2 level under . Let say A for above and U for under , we have...
So, I have been using the formula below to calculate swap rate: Swap = Lots*Open Price*Symbol swap rate (long or short)*1/(360*100)*contract size*quote currency to usd rate Below are my calculations for several symbols: Time  Type  Symbol  Lots     Price      Price  long rate...
Care should be taken to verify each ownership, status, and location of each Forex trading firm, website, or app before signing-up for a trading account. There are many websites claiming low brokerage charges and high leverage (allowing more trading exposure with less capital), some as high as 1000:1...
Take a look at the example provided at https://docs.mql4.com/common/webrequest i have added Alert(result[0]); to see what server respond back, Alert(result[1]);Alert(result[2]);.... The array result allways contains numbers now i want to know how to recive contents at the website I send webrequest...
Curious if anyone is interested in helping me write a script
  new member (1)
Hi friends I am the new member of the forum!!     
Hi. In the new post of my blog I let you a metatrader library that allows you to read data from a Web Page. Its use it is fully commented through an example with images. I hope you like it and I wait for your comments Best regards, Mestize www.forexmq4.blogspot.com
Hi, how can i enable dll imports in a chart template? If i drag from the Navigator the EA works properly, if i load from a template it fails. thanks for the fast answer, Istvan
  C program (1)
Hello, i am new to MQL4 and i wanted to know how can I run a program.c from my mql source code as external. I want the program to run continuously and at the same time mql extract some notes to a txt file so I can see them in the other day. Any help?? 
Hi there, Is there someone here who knows how return an array on a function on MQL? Like if your are going to retrieve a data on CSV, instead of using different functions to get data one by one all of the data on the CSV, i mean one row of data will be put on an array then when you use the function,...
Hi, I'm trying to create objects by looping through an array...... here's the code, but when I try to compile, I get the error "  '[' - invalid index error  " Can somebody confirm if it can be done, and what I'm doing wrong Thanks in advance. //---Create Array of Symbols we wish to interogatestring...
Dear,why dose below program always display  ” ordermodify error 130 ” ?    void OnTick()   { //--- if(Hour() == 1 && OrdersTotal() == 0) { int ticket=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,NULL,1,0,NULL);        for(int i=0;i<=OrdersTotal();i++)            {             if(OrderSelect(i...
Hi,   After build 940, global variables seem to repeat themselves and persist even AFTER deletion and restart of the mt4 platform.  I seem to have global variables dating back to December of 2015.... anyone else has this problem or know how to resolve this?    
So, this code will draw the trendlines using the coordinates correctly.  It doesn't matter what I set the RayLeft and RayRight values to, Left is always on (true) and Right is always off (false).  And what I want is the reverse.  Anyone got any ideas?...
  Hello everyone, Here's the problem, I can't see the "visual mode" feature when I want to back test manually. Anyone can help me about this?  I'd be glad if you can help me out.    
Is it somehow possible to carry dll as byte array in body of compiled .ex4 and deploy it at run-time and call functions? Does anybody have experience with it please?   thanks 
Is function Webrequest only for sending information? Can I use it to receiving information from a server too?
Hi there,   To prevent some boilerplate code, I want to read the file name, of the file a class is executing in..   There is no default MQ4 function available, but it should be possible with a native windows function (GetModuleFileName kernel32.dll) Source - https://msdn.microsoft...