MQL4 and MetaTrader 4 - page 762

To post a new topic, please log in or register
Hi, I am new to mql programming. I have a good knowledge in .Net programming language (c#, VB.NET). I read the books of MQL and now trying to implement my knowledge. I am trying to show the result of how may pips involved as a total in trades. Here is my code: int ReturnTotalLots() { int totallots;...
I have an EA that i will like to reset its external variables to the default setting within the EA after a trade is taken, can you advise on how to achieve that? Thanks Iddy
Dear MQL Community, i am about to port a Tradestation "PAINTBAR" study to metatrader4 and i want that it looks very similar to tradestation. As you know its not possible to paint the body or cloak of a bar to different color from mql. Does someone have any suggestion how i can look like a painted...
int h = FileOpen(FileName, FILE_CSV|FILE_READ,',');    for (int c=0; !FileIsEnding(h) && c<9999; c++)  {        if (FileIsEnding(h)) break;         ask[c]=         bid[c]=...             }  FileClose(h); Hi all, Assuming I have a CSV file with 2 colums (one with Ask and one with Bid price) for...
  OrderModify (6)
Hello: I have this in my code: // Returns result and error messages void PrintMessageOrderModify (bool ticket) { int check; check=GetLastError(); if(ticket>=0) Print("An order has been successfully placed with ticket # ",ticket,"."); // request is...
Hi, Newbie here so please be gentle with me! I want an EMA of 50 and a second one of 200, can you kindly confirm how I go about this. When I add Moving averages to the chart I'm not sure just where to add the 50 and 200. For instance, what does 'period' and 'shift' mean. Do I go to 'levels and add...
  Trading Bus (2)
To me trading is like a bus and trader is a passenger do not ride the bus until it take a direction, once the bus with the right direction will lead you to a profitable destination The direction of the bus can be determine with the help of your trusted indicators, I am using the following Support as...
I am pursuing my EA that trades between 3 trend lines drawn from a custom indicator. With great helps from this forum, I've managed my EA running but it has a bug getting wrong trend line value. (trendline "red" in particular) My biggest worry is that maybe the problem is the structure of the EA as...
I have googled, but i dont have found any informations how the fiboArcs are calculated. The problem is that MT4 does not give me a getValueByShift() functions for getting the levels at current bar, so i need to calculate them myself. If somebody know the formula or have a code example in whatever...
Noob, here I'm having a heck of a time trying to make an EA trade an indicator on 1 timeframe - while the indicator from another timeframe is in the same direction Seems that no matter what I do it either trades in one direction only, or NO trades Or maybe at best 2 trades and that all, LOL I need...
I have a live account with forex.com, 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
MetaTrader 4 MultiTerminal, as a new component of the MetaTrader 4 Online Trading Platform, is intended for simultaneous management of multiple accounts. MetaTrader 4 MultiTerminalwill be helpful for those managing investors' accounts and for traders that usemultiple accounts simultaneously....
learn forex currency trading online http://learnforex6.blogspot.com/
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...
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...