Forum

Ghost trade in demo account

Hello, I will try to keep it short. I noticed a weird thing with one of my EA's and perhaps you can give me some insight about it. I have an EA running on an Oanda demo account (MetaTrader 4). The EA is loaded into various different pairs at the same time. The EA is completely automatic and should

How is TickValue calculated?

Hello, I would like to know how the Tick value is calculated for pairs in which the account currency is not present. My understanding is that there is an implicit conversion from your account currency to the base currency of the pair first. Is this correct? Best regards

About the market being closed for the weekends.

Hello, I'm trying to improve my understanding of the Forex market. Perhaps, what I'm about to ask is silly, but I would appreciate some clarification in any case... As far as I know, the markets are closed to the general public (excluding big banks and such) during weekends... Why is that? Is there

Can't get the grasp on position sizing

Hello, I suspect I'm getting the wrong results from my code when calculating position sizing. What I want to do is, calculate the number of lots I need to open my order of. They are dependent on the stop loss placement, and the money I would like to lose if that stop loss value is achieved. My main

About the scope of variables in "for" loops

Hello, It is not a critical issue, but I'm a bit concerned about the future mainteinance of my code, and one thing I noticed is different from other languages (such as C) is the following. I think an example will be the easiest way to explain myself: Invalid MQL4 code: void OnStart () { for (

Is this code FIFO compliant?

Hello, I'm writing an expert advisor and I want it to be FIFO compliant. Note that I can have various instances of the EA running on different pairs at the same time. Also, there could be various instances running on the same pair (on different charts), each with a different magic number. When I

How to display an image in the chart?

Hi, I'm trying to display a .bmp file in a chart (not relative to a time/price, but to its coordinates from the top-left corner). I have tried this script https://docs.mql4.com/constants/objectconstants/enum_object/obj_bitmap_label but haven't managed to get it working. I got my file, called

Are global variables accessed atomically?

Hello, My EA will have various instances running on different pairs. Once a day, I would like to check the existence of new files in some directory. If they exist, I would like to relaunch all the instances, but just once. I was thinking to implement it using global variables, however, from the

Partial close order comment

Hello, When closing an order partially, it seems (I'm not exactly sure whether this is what happens exactly) that the order gets closed and a different order gets opened with the remaining quantity. However, the comment of the "remaining" order changes to something like: "From #51461". Is there any

Mistype in the documentation

Hi, I don't know where to send it, so I'm posting it here. In this page, https://docs.mql4.com/convert/stringtointeger The explanation says: " into number of int (integer) type." and the return value is supposed to be long. And on a personal note, I think those functions are bugged