Forum

How to determine the correct lot size for any given symbol

Hello coders, I know that there are other threads where there is a discussion about this topic, I found the code of William Roeder ( https://www.mql5.com/en/forum/133792/page3 ) and I tried to implement in my code, but I'm not able to find the unique formula which works for forex (3 or 5 digits)

API interface

Hello everyone. I know that mt4 and mt5 are platforms and they don't have APIs, but I wonder how I can do the following thing: Given the account ID of a user which has an account opened with a X broker and uses MT4 or MT5, and the related password, how I can read all the account informations like

Understanding one mechanic of Mt4 backtesting.

I found a multitime frame indicator which I report in the attached files. This indicator shows me its values in 4 different timeframes (one of these ones is the one plotted on the chart). This indicator seems to correctly work correctly on forward testing attaching it to a real time chart. However

Migration from mt4 to mt5 of an indicator

I found an old indicator online which I would like to convert in mt5, I tried by myself, however they give me different results and after days of testing I'm not able to find the right solution. I attach the two files. Thank you for your help

multi time frame indicator does not work in backtesting

Following exactly ( https://www.youtube.com/watch?v=dP4VrC_nhJA&amp ;list=LL&index=2) I coded the multi timeframe ema. However, when I try to use it with the strategy tester it does not work and I'm not able to find the problem / solution. I attach a photo where the Ema computation becomes flat

Tips for my Trading Panel

Hello, I'm here as I need some help with my trading panel. In particular, I would like to 1 - Change CLabel font (I'm not able trhough label.Font()) 2 - Avoiding panel hiding when I change template of my chart 3 - Any other tips is weel accepted

Everything to know before putting live your EA

Hello guys, suppose that the Expert Advisor you are building is finally ready to go live, it's optimized to the best of your effort and you feel confident about your work. What I'm asking is, what is essential to know and to check to put an EA live for the first time? For example, should we code

Opening orders at the price of the close of the previous candle.

I would like to open an order at the price of the close of the previous candle, is it possible to do that in some way? When I try to do it, mt4 gives me error 138 which means that " the broker replied with a “Requote” signal to your expert advisor’s OrderSend() function. That means that the price

Problem in uploading a Chart

Hi all! I'm trying to run my personal strategy using a custom Chart with the following code: void OnStart () { //--- example of applying template, located in \MQL4\Files if ( FileIsExist ( "MyTemplate.tpl" )) { Print ( "File my_template.tpl found" ); //--- apply template if

Color a candle

Hi, I'm trying to understand how to color engulfing candles, the code that I wrote for my idea of Up trend engulfing is: bool upEngulfing(){ // Second Candle double bodyBottomOne = MathMin (Open[ 1 ], Close[ 1 ]); double bodyUpOne = MathMax (Open[ 1 ], Close[ 1 ]); double bodyOne = bodyUpOne