MQL4 and MetaTrader 4 - page 949

I have a live account with, the problem I have is that MarketInfo("EURUSD",MODE_ASK) gives 0.0 and Ask looks fine?
I use the following MQL code to keep me out of the market when the spread is greater than 1pip (allowing slippage of 3): "MarketInfo(Symbol(),MODE_ASK)-MarketInfo(Symbol(),MODE_BID)<=1.0" My Question is: why am I still observing my EA take trades when spreads are higher than 4 pips? Can anyone...
  trailing stop issue  (15   1 2)
//trailing stop functionvoid CheckTrailingStop(){double newsl = OrderStopLoss();for(int i=0;i<OrdersTotal();i++){if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;if(OrderMagicNumber()!=exMagic || OrderSymbol()!=Symbol()) continue;if(OrderType()==OP_SELL && OrderSymbol()==Symbol() &&...
Dear All: I believe this has been asked and answered before. I am new to this forum. Sorry for the "old" question. I have written an EA. Sometimes, it failes to close the open position. My code related to closing are: OrderSelect(0, SELECT_BY_POS);//one and only one open position, so the...
i have been playing with this code to see how far i can take it but i got myself lost here else //close all positions if ((diClose0<diMA1)){...
I don't think I'll be able to learn and transform my Expert in time for this year competition. I'm just wondering if any of you active guys are in :)
Hi I am looking for an indicator that will plot POC of each M15 bar inside the bar.. is it possible? Thanks
learn forex currency trading online
I seem to be missing something in my understanding of code I read the lessons and documents and feel I have a sort of basic knowledge of coding an EA, yet I seem to be lacking some major understanding. This is very hard for me to describe the question because I don't know exactly where I am missing...
i am a forex trader but i cant write any code, please i need someone who can develop robot that will buy order using parabolic sar indicator and close order using zigzag indicator( i want a robot that will buy order once the first parabolic sar appear on buy direction and sell order when first...
I would like to know how many people here live trade without a stop loss. If you have constructive thoughts share them here with everyone on this forum. I will start this contraversial subject with a thought - If you are using a stoploss who's loss are you stopping - yours or the market's? How are...
  A/D divergence  (2)
Does anyone can share the A/D indicator showing divergence? Thanks
Hi ; i couldn t find any script that can open an order straight when the next candel open or when the current candel close .. does it exist ? i mean, i put this script during the current candel if i want to open an order direct when it close .. the stop loss will be juste under( over ) this current...
I want to make an EA that can automattically put buy limit and sell limit at specific time any body have a clue how to do it? i'm still very new and beginner in this MQL language any input are highly regarded. thanks
I'm studying the 2010 ATC Avoitenko's EA, There's a function called OrderCalcMargin() used in EA,which is defined as below: bool OrderCalcMargin(string symbol, // Symbol name double volume, // Lots double price,...
hi traders can u help me, i put 2 moving simple averageso one is period 3, shift 0.(yelow) one is period 5, shift 1.(purple) but how to set sound alert window when both crosses buy and sell. plzz help me
  Live Update  (3)
I recently had cause to install a new instance of MetaTrader because I couldn't figure out how to upgrade. I've read various clips and it appears the upgrade feature should be 'automatic' .. but this doesn't seem to happen for me. I have just completed a reboot and metatrader starts up - see
All trading (except when based on external information) relies (consciously or not) on inferences about the statistical properties of the market in the future from statistical properties of the market in the past. It seems useful to look at statistics more general than the results of a particular...
"Arrays cannot be passed to the Comment() function. Arrays should be output elementwise" so is there a way to put in the all array in one string? like this string array[];for(int i=bars;i>0;i--) {  if(iRSI(NULL,0,period,PRICE_CLOSE,i)>70    array[i]=DoubleToStr(close[i])+"\n"; }string str=.....(put...
  help with sar EA  (2)
hi here is my sar EA .... i want it execute once every new bar buy or sell //---- Trades Limitsextern double    TakeProfit     = 500;  extern double    StopLoss       = 420;    extern double    TrailingStop   = 0;   extern bool      SmartClose     = false; //---- Hour Tradesextern...
Hi,I am new to programing and I am trying to write an EA that trades between 3 trend lines (red, yellow & violet)for example, if the open price lies between yellow&violet, then StopLoss(SL)=violet & target(TG)=yellow(bullish market)once price breaks through TG, scale out 50% and the remaining 50% is...
Hello, i am new to this site but i have a pretty general question i hope. I am trying to back test an EA, i was told and have read that using the optimization button it will run through all the numbers and pick the best setting for my EA. So now to my question, when i use the opt button it doesnt...
I am trying to "force" the scale (Y-Axis) of my custom indicator to run from lower level X to upper level Z. Currently the indicator seems to shift the Y-Axis upper/lower boundaries according to a "best fit" which isn't working well. Any insight greatly appreciated-- M
I am basing my indicator of the Ichimoku indicator and I need the values of Senkou Span A and Senkou Span B. The problem is that the indicator works for all the bars on the chart, but I the Senkou Span A and B are ahead or shift 26 periods forward and I can get my indicator to draw past the Bars on...
  indicator colors  (7)
How do I make an indicator in a sub window where I declare the level values because I want a scale to the right side of the subwindow but I do not want any horizontal lines. I could not find a Color Constant for "None". How do I accomplish this?
  OrderDelete  (5)
Alert(Symbol(),"  OrderTicket  ",OrderTicket_TM);       bool Ans_del=OrderDelete(OrderTicket_TM,Yellow); Hello, The above command delivers error 4108, invalid ticket. Despite the Alert infront of the OrderDelete command displays the correct order ticket. OrderTicket_TM is defined as INT. Any idea?
Hello, I have some problems to use several criterias for market operations. For example, for selling: 1) First I want price to reach some resistance level (red line) 2) Second, I need to wait for market to broke under some lower level. I don't want to use OrderSend with limited time, as I need more...
Hello MT Admin, Please provide me the download link for the MT4 API. Regards, Aman
  mt4 .net api  (2)
Hi, I am using the old mt4 api (c++) and we would like to start using the new .net mt4 api. After a short review of the MetaTraderApi Dll, I could not find a way to create new Account in mt4 trading platform . Is it possible ? if yes, can you please send me an example or the name of the class and
Would anyone be willing to code this EA to work at Smart Trade FX? Here is the location where I downloaded it: Thank you! I very much appreciate it. Sherry