MQL4 and MetaTrader 4 - page 145

To post a new topic, please log in or register
Hi Guys, I'm currently working on an EA. I got an TDI Red Green Indicator. Every time there's a cross of both lines, there shall be ONE trade. So if the red line crosses above the green line, there shall be Short trade and every time the red line crosses below the green line there shall be a long...
So im writing a EA that will make use of live trade historical during optimization and i thought of writing the results to a csv when running and read during optimization. Option #1: Read the scv during init and write to array? Option #2: Read from a database(sql, etc..)   Is there an easier way ?...
Hi,  I need some serious help with modifying my scripts.  I think it will take me days to months to try to understand and come up with the coding myself. I learnt a trading concept from a trader online and tested it using my live account. I would say, the probability of winning is high and I have...
void tick{ //How would I get WantedValue to test against if(CurrentAsk < PreviousAsk+WantedValue){ OrderSend(XXXXXX); } } //////////////My Functions double My_Function(double WantedValue){       WantedValue = 0.051;       return (WantedValue); }
  set 12:00 am (6)
Hello to all. taking as an example the code iBarShift, how can I change the date in the hour 12:00 AM of the current day without having to continually change the day? thank you datetime some_time=D'2016.12.02 13:45';       int      shift=iBarShift(Symbol(),PERIOD_CURRENT,some_time);...
Hi All,   I dont know if im having a dim moment and over looking something really simple. Im not a big time MQL coder got into this quite recently but am pretty skilled in VBA.   Ive build my own EA using some Custom Indicators but these indicators could use some improving so stripped them down to...
I am a new coder in MQL4.   I am working on an EA that will delete all pending orders after a single pending BuyStop or SellStop order is executed and changed to a Buy or Sell. My results are mixed, it seems it is working if the Sell Stop is executed to a Sell, the Buy Stop is deleted. However, if a...
If I run the EA on 1 chart, 1 currency eg:AUDUSD only, it identifies the Ordersymbol == Symbol() , When I run the same EA on another chart with another currrency attached Eg:EURUSD on the same MT4 platform (2 currencies running on seperate charts) it returns "false" Ordersymbol doesnt equal...
Hi, i need a help.... This is my first EA and i am a beginner... can anyone help me to put Trailing stop for my EA ... i tried many ways but trailing stop is not activating when i am putting it on strategy tester... please help... this is my full EA(based on CCI for H4 and Daily TF, preferably...
Hi Experts, i need know when the last minute of day is running in my EA. It's for backtesting years of DAX-Index in order to close some postions at end of day. Usually it's always the same time hour=21 && minute=59. But unfortunately during years it has been changed in the DAX-Index often and my...
Today I restarted my Laptop after about a month ago. Now I get an error on starting MT4: "Fehler beim Erzeugen eines leeren Dokuments". (in english: failed to create empty document). I got Windows 7 x64. MetaTrader worked perfectly till today. After the Failure, MetaTrader is open, except the Chart...
Is there a function for this dashed line between opening and closing arrow of one trade?
Hello I want to know how to calculate the initial negative profit immediately after opening a position. Is it just a function of spread and lotsize? Or there are something else that must be considered//?  Please tell me the formula for calculating this.   thanks 
How to calculate the minute elapsed since opening a position Can this be true: if(TimeMinute(TimeCurrent())-TimeMinute(opentime)>60) { .... }    
Hello,   I was wondering if anyone had any example code for opening trades during certain days.  I'd like to only open trades Sunday (when market opens) until Thursday.  If the trades are profitable by Friday, I'd like to close them out.  I'd like to do this to eliminate gap risk over the weekends....
Hi, I'm hoping someone can me please? I have been writing in mql4 a dashboard for my trading strategy, I have about 20 pairs open as well, and the dashboard provides a central place to report various information. I have coded a button (I'm using rectangle label) and passing the chart ID by a click...
Hi there, I was wondering if there is any way to view the stop loss amount in a new order by currency instead of by pips? It is now often totally unclear to me how much I will lose or win when setting a new order. Is there a setting for this? Or a tool? Thanks in advance, Johan
Hi,  I´m assuming this question came a lot but I couldnt find anythin helpful.. Currently My ea works like: if(OrdersTotal()==0){ placing order ... etc .. }  The problem with the code above is, that it stops trading as soon as one order is open regardless of the conditions to open a new order. So...
Hi Everyone, Backtesting an EA and have noticed some incredibly strange profit results: Long trade is trailed out 4 pips above the entry price but results in a $67 loss Commission charge is only .7 pips, so should still be a 3.3 pip profit. Account is in USD and lot size .21 = $2.10 / pip. Any...
Hi guys, I am developing an EA and one of the exit strategies is when the RSI flats out. For example: http://d.stockcharts.com/school/data/media/chart_school/technical_indicators_and_overlays/relative_strength_in/rsi-2-rsplot.png Look at between 3 and 5. The peak becomes flat. In these moments, I...
  mediate the price (13   1 2)
Hello everyone,I explain this problem now ... how should I do to open a position, in the same direction of the first position, only after another loses for example 100 pips?I do not take the stoploss, I just need to open a position that you will close to target or if it goes back again to 100 pips I...
I'm new to MT4. When I save a profile, such as EURUSD with three different time charts, then open another profile such as AUDUSD with three different time charts, I now have all 6 on my display. It seems to me that I should be able to change profiles and not pile up charts into one view.  What am I...
Hi, Is it correct that live the time of MqlTick does not show fractals - the last one from Friday doesn't show any? Fractals would mean that each new tick would have a different timestamp (fractal) than the previous one, while otherwise several ticks within the same second would have the same...
does higher time frame has more control points than lower time frame in optimization?
I have a live account with tradersway.com and I want to open and use two MT4 accounts at the same time with different account numbers on the monitor.  Please let me know how I can do this.  
Hi I'm new in Mql4. I'm trying to create an ea based on the choppy market indicator. I've identified the buffers as follows:    double cma=iCustom(NULL, 0, "CMI",60,10,false,3, 1);//smoothed ma    double cmil = iCustom(NULL,0, "CMI", 60,10, false,0,1); //cmi line    double cmilg=iCustom(NULL,0,...
Hi guys, I'm trying to place a short order via OrderSend but I get error #130. Since I'm a noob in MQL development I'm sure you can solve this issue really fast. :P So here's the code snippet: double takeProfitTotal = NormalizeDouble(Ask-(TakeProfit*Point),Digits); double stopLossTotal =...
Is there any way to execute a code on an external event instead of executing thre code on every tick? For example when a .txt file in MQL/Files folder gets refreshed.   The idea is to send information/quotes to MT4 by an external (e.g. Java coded) program. This (Java coded) program creates/refreshes...
i have  subscribe in signal Small to big money please how i can changing lot size to 0.02 or 0,03 thank you very match