MQL4 and MetaTrader 4 - page 194

To post a new topic, please log in or register
I want to declare an external integer variable for day and add it to a datetime variable, Is it possible? I need some code Like this, to get for example 10 days from an external variable an add it to my datetime variable. Should I first convert days to millisecond then add to datetime?  how can I do...
When an object is CREATED by an indicator, it doesn't trigger OnChartEvent(). But when an object in DELETED by an indicator, it does. #property strict#property indicator_chart_windowint OnInit()  {   ChartSetInteger(0,CHART_EVENT_OBJECT_CREATE,true);   ChartSetInteger(0,CHART_EVENT_OBJECT_DELETE...
I am a programmer in MQL4, i am still learning, i have some good indicators for 60 seconds Binary Options and would like to transform this signals into a EA (Robot) for Binary Options, i have no clue how to go arround this and i see no information in the internet. Do you use the  same language mql4...
How can i open a position with known dollar value? Let say i want to trade AUD/CAD or AAPL, or any other asset, and i want to open position which value is 100$. How can i do this in mql4? Thanks.
Hello, I should fix the arrow when the moving average crossed the fractal channel as written in code. The problem is that if you create another minimum on the first tick of the candle 0, the arrow is not present. How can I fix? Thank you if(iMA(NULL, PERIOD_CURRENT, MediaM_Periodo, 0, MODE_EMA,...
Hi, please, I just installed MT4 for Mac and i can not change speed in testing mode. Is there an issue ? it seems to work in very low speed, and certainy not at 32 . There is no cursor. Thanks for you future answers. 
Sorry English is not my native language,  i try to explain what i want to say as title, I think that is the data in Period_H4 don't have been updated (BUT PERIOD_M15 have updated), iMA(NULL,PERIOD_H4,13,8,MODE_EMA,PRICE_CLOSE,1) = > it should get the price of last candlestick (index 1)  In fact, it...
Hi I have seen If two object crossed with each other then the cross section get white or in other color. Is there any way to avoid that?   I don't want the white area, I want it to be full blue. How can I do that? One thing predicting object cross section are is not possible as its dynamic. Regards...
Hi. Why this simple code (attached) doesn't work with takeproft and stoploss below 7 pips?
hello, I have another question for further growth in programming. I have this script that I need to connect to my indicator, every sgnale / Arrow script run one scrennshot. After studying the script I always get errors like I could solve? Thank you all P.S.: sorry for my English and my poor...
Hi community, for my EA, I need a function that is able to show the market value of SP500 when it opens and when it closes from the previous day. Does something like this exists and if not, what I assume since I didn't find anything, has anyone of you an idea how to solve this? Best regards...
I need help programming an EA that buys (OP_BUYSTOP) when a candle hits lower band that simultaneously sells (OP_SELLSTOP) also. #1 CONDITION. sells when a candle hits upper band, and also opens a simultaneous order that buys. #2 CONDITION. THANKS ALOT. David.
Hello everyone, it is possible to obtain the moving average no repaint? By working with well-known moving average that in the historical shifts and is no longer true as I could solve?...
Hi, is there anyone who could tell me if is't possible, by coding, to modify the speed of the backtest ?   I'd like to decrease it during open position in order to see better, and increase it after. But with code, not with the cursor.
Hi all I have been trying to get an Ea to run on a Renko chart and have had no success. Even when I run a one line code -----Print("Got Started"); it does not work The same line of code will print to Experts log on a regular time frame chart. Leads me to think that Ea's will not work on Renko charts...
im having trouble finding the functions that allows me to report number of trades and profit the way i have these other varibles displaying      Comment(StringConcatenate("\nCopyright © 2015, Jasper\nViolentPips EA v1.0 is running.",                              "\nMomentum delta : ",c...
Hi, please, can you tell me if spread is always the same during a backtest or if it changes like in real ? in memory with archived data?
Hey, Is it possible to retrieve a Ray value of a drawn ray line in the past, Or do i have to calculate it myself (how?) Thanks   
HI, I know it has been discussed here. It was an indicator that looks quite interesting but is nothing but an ema. I remember there was a post that shows the original indicator and the ema and after some bars both show identical values (line). Doe anybody remember the name?
Hey all!  I recently started programming my very first EA. It may look a little confusing at first but i hope it is readable. Th reason for this post is that i have encountered a problem. It comes down to this. I want to execute a buy order once 3 requirement are met....
Hi, please, my brooker (pepperstone) tell me that price on chart is bid price and if i want i can add ask price. Is it possible to visualise medium price ? thanks for your answers. 
Hello guys, i am programming EA which has entry based on pivot points. For example condition that top wing of bullish candle touches pivots R1 or R2 or R3. ( i have already programed all highs lows etc. or values for pivot points that not my problem.)       (   ((high1>=R1_1 && close1<=R1_1) ||...
How do you make the " ex4 " used for a predetermined time " X " ?
New article Universal Expert Advisor: A Custom Trailing Stop (Part 6) has been published: The sixth part of the article about the universal Expert Advisor describes the use of the trailing stop feature. The article will guide you through how to create a custom trailing stop module using unified...
The code excerpt from where the error is this      for (i = Bars; i >= 0; i--) {       TrendUp[i] = EMPTY_VALUE;       TrendDown[i] = EMPTY_VALUE;       atr = iATR(NULL, 0, 10, i);       medianPrice = (High[i]+Low[i])/2;       up[i]=medianPrice+(Multiplier*atr);...
Hello everyone ! Good Afternoon! I am going through a problem i have build an EA but it is behaving strange . It works fine for five to six trades but after it on 7th trade or any further trade it places trade hits TP and after it it started to place pending orders close it and again places a trade...
Hi All, I have an indicator which worked perfectly up until build 971. It draws a series of trend line objects on the indicator window to represent altered candles. After build 971, it seems that the indicator minimum and maximum are at huge values, though they are not set anywhere in the source...
Hi,   I've seen in the past examples of EA who cheat by directly reading *.fxt history files & create fake results in backtesting.   It's easy to tell just by looking at the mq4 code, but what if I don't have access to the EA's source (only the compiled *.ex4 demo)?   Is there a way to detect if an...
Hi all! Do you guys know of any crosshair app on mt4 where i can execute trades at the level my crosshair is pointing? thank you!
Hi, I noticed something interesting on MT4. I opened 2 charts, both are Crude M1. Then I attached the same EA to both charts, however each chart has a different magic number and different set of parameters for the EA. I found that the second chart tends to do only 1 trade and then it does not open...