MQL4 and MetaTrader 4 - page 1428

[Deleted]
  OrdersTotal()  (4)
Hi all, Trying to call this function to check no. of open buy orders... When the code is called as a function from start() it always returns 0. When the code is placed in start() at the same place as the call it always returns correctly...??? Any ideas? TIA LL...
If there is no info on ticks in history, where are the ticks in tester coming from? I am not blind. I am serious. The history file contains only Open, High, Low, Close and Volume info. When we test the EAs, we see ticks. And we see the price TICKING up and down even on M1 time frame. When I asked...
[Deleted]
I am new to programming the algorithmic language for MQL4. I am trying to program a script that will read prices from a txt or CSV file and insert horizontal lines in a chart for each value. Sometimes there could be 60 to 70 lines per chart. It would be nice to also be able to set the color property...
[Deleted]
I love it when a position moves significantly into the green. So say a position has $200 profit showing. To lock in those profits, I'll rush in and set up a new stop loss at say $100 profit. It never fails to always bounce back, hit the stop loss, and then move another 50 points in the direction...
When i add an indicator using iStdDevOnArray to my chart, MT4 memory jumps by 10megabytes Open "empty" MT4, 24 megabytes in use. Add indicator below, un-comment iMAOnArray function, compile. Memory usage barely changed, still 24 megabytes. Comment out iMAOnArray and un-comment iStdDevOnArray....
if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); { sellstop=OrderSend(Symbol(),OP_SELLSTOP,Lots,NormalizeDouble(OrderOpenPrice()-50*point,digits),3,0,0,"try2 sample",magic,0...
[Deleted]
I have no programming experience and I have put about a 100 hours into learning and coding my EA. It does what I want it to do, but it will set a stop order and may fill it 4 hours later. How can I get the ea to execute buy or sell stop on the next bar only or wait until the criteria happens again....
[Deleted]
To have my ea place a stop order entry at the high of the previous candle, do i need to set the high price as a new variable or will the ordersend function accept chart based price data such as high low etc?
I know it sounds like a stupid question but my thinking is that if the mobile MT4 does the same job and works on a desktop then it must use less resources and that opens up other possibilities like running many copies on different brokers or using older computers with less ram. Does anybody have any...
[Deleted]
double close240 = iClose(NULL, PERIOD_H4,2);double High240 = iHigh(NULL, PERIOD_H4,1);double PreviousHigh240 = iHigh(NULL, PERIOD_H4,2);double Low240 = iLow(NULL, PERIOD_H4,1);double PreviousLow240 = iHigh(NULL, PERIOD_H4,2);double LowerBand240 = iBands(NULL,PERIOD_H4,20,2,0,PRICE_LOW,MODE_LOWER...
Hello i have COT data but in .PRN form, how how can make MT4 read such format( in separate window ) Regards
[Deleted]
Hi, i need someone to write me a file that will simply place a solid red line onthe london open (3am ET) and the US open (9am ET) for the entire historyof the data.
Hello, how would i output in my script how many seconds has past since 1970? I expect the number to be in a format ########## (probably quite a long number...) Thx! I tried looking up the date time format, but im kind aconfused (and new a coding) could someone possibly write exactly what i...
Gidday I am looking for a mm system that is based on using the daily range as the TP and SL. They way I am looking for it to work is the greater the range the more of the FreeMargin is risked and vice versa. I have attempted to code it my self but have had a bit of trouble My maths might be wrong...
Hi, I'd like to altern buys and sells op for my ea, but it keep on buys or sell.. I check the history tab with a loop with this code : int AlternBuySell(int MagicNumber) { int altern=0; int histb; int histbs=OrdersHistoryTotal(); for(histb=0;histb<histbs;histb++) {
[Deleted]
Hello All, I want to calculate the cost in account currency for 1 lot, so that I can now how much money I will lost/profit for 1 pip move. With this info then I can calculate in advance how much I will lost if stopped with stoploss, or how much I will profit if takeprofit is reached. Any hint?...
Hi. I have data for various pairs, but I can only get as far back as 1999. Can anyone assist in how to get data from 1989, because I need a longer term to better test an EA I am working on. Thank you. Lance.
  2'000 => 400'000k in six months!  (33   1 2 3 4)
Well, easy said. ive been developing EA for over two months now.. I had many EA, all based on different indicators, different variations etc.. But then I decided to create my own very simple EA working on very simply algorithm.. Not gonna describe the results, check the pictures and tell me what you
With AUDJPY/M1 I stated that in charts for the period are missing 19 September 2008 until 26 January 2009 the bars. How can one close this gap? Or from where can one load the missing data
[Deleted]
I am just a beginner at building EA's, and scripts. I am still learning and still got a ways to go. Anyways in the mean time I want make in alert script to make my manual longterm trading much easier. I am in research mode to make an alert script that will notify me when a price hits a strong...
[Deleted]
  Error #130?  (20   1 2)
Hello, I have an error message #130 and I don't understand what is it... I trade on the EUR/USD forex. if (OrderType()==OP_BUY && OrderSymbol()==Symbol()&& OrdersTotal()==1) { OrderClose(OrderTicket(),OrderLots(),Bid,0,Green); } ticket=OrderSend(Symbol(),OP_SELL,lots,Bid,3,1.40,1.30,"Ordre Court",0...
Hi Everybody I have made a custom indicator that displays in a separate window that shows as a straight line. The reason is that I am using one buffer to feed back integer values about the state of the indicator and this buffer, although set to DRAW_NONE, interferes with the maximum level of...
Hello... Please advice me regarding the buffer calculation in the indicator. I modified iExposure.mq4 to show profit factor. but no data shown on the indicatorif added below code....
Hi, The subject listing pretty well sums it up. I’m new to ForEx and am using this commercial EA (FapTurbo v47 b225) on the MT4 platform while I am learning. With the default settings I was losing money. I’ve managed to tweak it so that it is slowly but surely gaining a little now but obviously...
[Deleted]
When closing orders, do I have to reset or clear the value for " OrderTicket() "? I've noticed that when closing one order and opening another, the ticket number for the order being closed is the same number as the order being opened. And often the order to be opened doesn't.
Hi You all seem to get MT4 working on Linux but I can't. HasAnybody done it under SUSE 11.0. I installed a PCB layout prog and thatworks fine but MT4 gives a grey error screen of a critical windowserror. I don't know where to start to fix it. Thanks
[Deleted]
Has anyone looked at or know of/about the Weibull Distribution? http://en.wikipedia.org/wiki/Weibull_distribution I was reading article on LED performance and the critical factors of current and heat. How they influence LED >xx% luminance life expectancy. ref: Philips Lumileds. Apparently is vip to...
so if you want to use the average range of the last 1000 bars of the current chart: sum(high-low)/n, how would you code this to use as a variable in your code? This would need to be adapted somehow.. for(int i=0; i<limit; i++) { CurrentHigh = iHigh(NULL,0,i); CurrentLow = iLow(NULL...
Dear Sir, do you know some code for calling price close at specific time? exmp; extern string Asia_Open = "02:00"; extern string Europe_Open = "08:00"; extern string LONDON_Open = "10:00"; extern string US_Open = "15:00";...
  lessons  (1)
MetaTrader programming lessons Live trades every day Backtest