MQL4 and MetaTrader 4 - page 1204

To post a new topic, please log in or register
Hello, I'm trying to calculate the EMA of the MACD histogram. But the return value seems incorrect. Is there any mistake in my codes? Below I'm trying to get EMA 21 of the default MACD histogram. double mcd[100];int EMA_MACD=21;    for(int d=0;d<=100;d++) {   mcd[d]=iMACD(Symbol(),0,12,26,9...
Hello I am trying to keep track of and use the most recent OrderProfit in a calculation for Lot Size and I'm not sure if I'm going about it correctly. Here is what I'm doing: double LotSize(int takeProfit, int gam, int stopLoss) {    cap = AccountBalance() / (stopLoss * 0.01);    les = profit *...
Hi guys I am recently trying to code Fractal based . I ve finished one here. I would like to get some feed back from many of hard coders if it is working fine comparing to other version on this web site Also I would like to find out wheather there can be shorter way of doing this or other...
When I use this MA EA to trade, it doesn't actually draw the MA so one can see visually what is going on. What would be an easy way to add some code which would take care of drawing the MA?
Hi can anybody tell me how you add funds to a demo account i started with 5000 but want to add a further 5000
New article Layman's Notes: ZigZag… is published: Surely, a fey thought to trade closely to extremums visited everyapprentice trader when he/she saw "enigmatic" polyline for the firsttime. It's so simple, indeed. Here is the maximum. And there is theminimum. A beautiful picture on the history. And...
  week of month (2)
Can anybody tell me how to code so my indicator can recognize the first to fourth week of the month? Thank you.
  cycle of MT4 (8)
Dear ever one, I do not understand how work MT4 What is the time of a clycle? How many cycle in one second? is it possible to select it with a parameter? thanks in advance.
After using MetaTrader for optimization of tradingstrategies for a few months I am not happy with it for a variety of reasons andthinking about writing my own tester/optimizer in Matlab and one of the mostdifficult questions I am facing is: what should the objective function looklike? I have...
Hi all here, i've created a indicator with different lines. For example how Stochastik is If i want to use this indicator in the EA and Access with iCustom, who i can get the value from the different lines? In Stoch i can access with the MODE_SIGNAL or MODE_MAIN... Any glues fpr me please? Thx and...
I have MetaTrader running out of several folders. Two of the instances open just as the layout existed when closing. The other one always reopens with just four chart windows...making it necessary to manually set the toolbars and data and terminal windows manually. I have saved the profile to...
I wondered if any bright spark here nos how I can store a value I get for a new bar and then for the next bar that closes, add to this stored value and then keep the new value? What im trying to do is to find the difference in close price for bar1 and bar2, so bar1 - bar2 = difference in close price...
I want to use MT to get data feed from other server such as IB. Then send order back to interractive broker for execution. Is there a way to do it?
I am working on an EA and not sure if it is technically possible. I want to use a custom indicator within the EA. The issue I have is the indicator uses double b1[ ]; SetIndexBuffer(0,b1); The code complies and loads into the chart, however I am getting this error message: SetIndexBuffer...
when downloading history GLD "There are no new data for a symbol GLD" ???? what happen? how can i download it ?
Hello, I'm new on this forum, so first I want to tell Hi to everyone :-) I nedd help with coding EA. I have indicator (Zoppoter System A) - it has tree values: 1 (green bar), -1 (red bar) and 0 (no bar). In my EA I need to observ indicator at 10:00 local time. If indicator has value 1 at 10:00 I...
dear every one, I would lik to put all the existing orders in a double array in the begeening of the program. there is no more than 10 orders total. array tab[10][ticket,open_value,lot]; for exemple the ticket of order N4 will be: tab[4][ticket] is it possible to do this? thanks in advance
I understand there may be errors associated with doing this.
dear every one, In don`t understand sur function: MarketInfo(symbol():Mode_stoplevel)) what does it do? thanks in advance
Hi, I am facing a problem of Timeframe for iMA. See below:- int timeframe=30;int period=10;double MA =iMA(NULL,timeframe,period,0,MODE_SMA,PRICE_OPEN,0);//inserted into open sell positionif(MA*(1+Percent/100)) trade=true;//inserted into open buy positionif(MA*(1-Percent/100)) trade=true; The code...
If I try this it returns 'function is not defined'
Here is aforex trading education tip: moving averages are rightly thought of as asignificant technical trading indicator. Using moving averages to analyze timeseries data like currency pairs, can help traders spot trading peaks andtroughs. More on this subject and more can be found at ForexFace.com....
Hi, When i change the template on a chart, i lose all the trendlines I had previously drawn. Is there any way to remedy this situation? I will appreciate any help. Thanks, Arooba
Hi!! One more time I'm here to learn from you ;) I've writen a loop to manage profit. I want to close all open orders from all pairs open by an EA if equity is more or less than a percent of balance......but dosen't work. The loop is into the EA. Thanks for your help. This is the code: void Manage...
I see only one section Forex forum. What about communication in this forum forex traders? A lot of technical issues which I do not quite understand.
Hi I use the IsTradeContextBusy and IsTradeAllowed to ensure a BUY or SELL order is made. However I encountered an occasion today where the server accepted the order but no trade was taken. Reading the journal, there was apparently a requote. How can I get the EA to accept the requote. My end...
Package of intrinsic indicators in MetaTrader is quite small. Where can I find free indicator library for use in MQL4? Thanks
I have received the letter of the following maintenance and have decided to answerit at a forum. Hi, I found 2 bugs and I am pretty sure they are bugs: 1. When you have: double x = 0.0003/Point; int y = x; sometimes you get 2 and sometimes 3! Cannot convert double into int variable evenwith...
Simple question - is Open[0] suppose to change in an EA when being strategy tested? Does not seem to be when I Print it?
Before reinventing the wheel.. wonder if there is any existing code that does this: - Check if price has crossed a threshold in the wrong direction - Automatically hedge the position: open an order with the same amount of the existing one in the opposite direction.. Thank you.