MQL4 and MetaTrader 4 - page 301

To post a new topic, please log in or register
Hello, when I launch an expert advisor based on divergences, it draws lines on price and on stochastic but when I backtest it, the lines are not displayed on the stochastic. Could you help me with that ?
Hi all, I don't know how to recall the last bar open time. Could you help with the below code? I need to replace the string "LAST BAR OPEN TIME". Thank you!!!    total = OrdersTotal();  Num_Order_Long_6  = 0;  Num_Order_Short_6 = 0;    for(cnt=0;cnt<=total;cnt++)     {     OrderSelect(cnt,...
Hello folk,  I was wondering if anybody of you know a reliable way to programmatically abort a MT4 backtest. The point is that if during an optimization pass a given halt condition is met, (e.g. DD > 5% or a custom OnTester() value is over a threshold etc...) there's no reason to continue the test...
Hi,   I'm trying to figure out a way to create user defined variables based on the Bid and Ask price that will be set when the Expert starts and that stay the same until the Expert is de-initialized or the values are changed programatically. In other words I don't want the value of my variables to...
Hi:   Is it possible to color the candles in program? for example, if the candle close is above 20 Moving Average, I want to color the filled bull bar in blue and bear bar in a blank blue bar. If the price is above 20 MA, color it into a filled red bar for a bear bar and blank red bar for a bull bar...
my accont banned. help meee?
Hello I can not increase the number of buffer: I have put IndicatorBuffers (12); initially 8by allocating additional buffer for a table and a label (my_info ...).SetIndexLabel(8,"my_info"); //Sim SetIndexBuffer(8,my_info);   //sim   SetIndexLabel(9,"my_info2"); //Sim SetIndexBuffer(9,my_info2);...
Hi..Ive looked around in MQL documentaiton to see if there is something that could help me count my trade volume in each candle, but couldnt find anything. The only function i found was Volume[0], which calculates the total volume for the bar, which is not what I want. Is there any function, or any...
Hi forum, I made a script which should change the current timeframe to M1, then make a screenshot and change the timeframe back to the original one. But I always get a message from metatrader if the script should be terminated. I read in the documents that ChartSetSymbolPeriod() is asynchronous and...
Good day,I need help create this indicator for Intermarket spread chart ,just a simply subtract the prices one market from the other and plot the difference as a line chart (the closing prices) in sub windows so that I can apply indicators into it.Thank you. Attached the sample chart.
Hello there. Im trying to sell one of my EAs. Im thinking in giving a client a DEMO of the EA, capping its use with some function like: "if(TimeYear(Time[1])<2016)". Is is my EA safe with new version of metatrader safe? I heard that version 600+ is very difficult to decompile. Thank you
  EA signal (6)
Hello,   Waht I need to write in the EA code if I want that every time the indicator(attach) change color the EA will open BUY/SELL order?  
Ok this is very strange, Im working with a indicator bought in the mql5.com marker.  The indicator in question is this one:  https://www.mql5.com/en/market/product/4518 Ok so I have this indicator activated in my terminal and I can make use of it. And in the image below you will see that I can...
Guys, Have anyone here tried to play any forex based games or contest? Would appreciate all your advices.
Hi guys,  I have indicator sending notifications.  I want to limit sending notifications to one or "n" per Period set on chart.  Do you have any idea how to limit it? Thanks for help in advance. 
Please, help as the above symbols are missing. How can i get them back?
New article Bi-Directional Trading and Hedging of Positions in MetaTrader 5 Using the HedgeTerminal API, Part 2 has been published on mql5.com: This article is a continuation of the first part "Bi-Directional Trading and Hedging of Positions in MetaTrader 5 Using the HedgeTerminal Panel, Part 1". In...
Hello,   How to make hotkey for "Vertical Line" in MT4?   Thanks, Max 
Hi, Need help. i installed this Forex Currency Indicator(FCI) and trend scanner on my MT4. Vers 4 build 765.  Problem is Forex Currency Indicator. This indicator appear back on graph as per picture i attach. How to pop up window it like the other below? i mean like other standard indicators. i cant...
After posting a message to service desk, asking for zoom in shortcut as in MT5 (which knows about "-" and "=" keys on first row on keyboard) they told me I need to use Shift + "=" to zoom in. huh? thats very intuitive, thanks but no thanks.  I searched for a solution, and the most flexible was...
void OnTick()  {      double vol=0.01;      Print("AccountFreeMargin before:",DoubleToStr(AccountFreeMargin()));      Print("AccountFreeMarginCheck:",DoubleToStr(AccountFreeMarginCheck(Symbol(),OP_BUY,vol)));      OrderSend(Symbol(),OP_BUY,vol,Ask,0,0,0,"test",0,0...
Is it possible to move the Trading Panel in MT4? I would like to move it to the right hand side of the chart.
  orderselect (2)
Hello. i have a problem with OrderSelect() this i the code a made but ther orderclose never carry out. so if someone could help i´d be very grateful.  input double Lots=0.01; input double macd_rapido=12; input double macd_lento=26; input int macd_signal=9;   input int slippage=3; input int...
Hello guys, I have question for connoisseurs of MT. I wonder, how does the tester in visual mode. Let's say that the main period of the strategy is to 1 h, I set the best mode of testing the quality of the data. I run the tester, MT downloads 1 min data ( in ../tester directory), and the chart will...
  tester... (4)
hello everyone In MT4 In the tester is it possible to automatically eliminate some tests optimization? For example: In an EA I have the option to use (true) or not (false) the parameter "traillingstop." With TS = true, the tester evaluates the parameter "distance". ok But with TS = false, "distance"...
I am using MT4 v4 Build 765 and I wanted to create a new version of an existing custom indicator - which I have done. I created the files 'as indicators' in the MT4 developer window and can see both the old and new indicators in the Navigation pane. Both compile OK but.... the new indicator doesn't...
I try to port an indicator from MT5 to MT4, and this error is all over the place. for example: 'ENUM_APPLIED_VOLUME' - declaration without type        utils_mql5.mqh  353     69 Apparently this type is not recognized, although I find it in mql4 docs what can I do about it? Is this a bug? Am i doing...
Dear Gurus in the house, Please I need enlightenment on this: I used 30p for my stoploss and 30p for takeprofit also but after the ea opens the order, I noticed that the stoploss points was higher than takeprofit point sometimes by almost 10p. What do you think might be responsible for this as when...
Ok guys,   I am at a total loss as to why this isn't working. I have a nice snippet of code that I like using to optimize the lot size based on a percentage of account balance and the stop loss that's been set, but I don't know why the EA is only keeping it at a constant 0.1. I have been trying to...
Ok.  I'm trying to learn how to draw lines using the classes provided by MQL4.  I put this in a script to attempt to just draw a simple line.  But when I drop it on the chart, I don't get an object created.  Can someone show me what I'm doing wrong? #property strict#include...