Forum

PositionGetDouble(POSITION_PRICE_OPEN) retrieve wrong open price

Hello, Im writing an EA which I want to keep an position's open price in double 2d array. (Please focus on the highlighted price) from the above log, the value on the left is the expected price which I would like to keep it as an index. The value on the right is the actual price that I find the

Double give me wrong value after it was calculated multiple times

I get the open price value from the selected position . Assume that the selected position price I got is 0.20 Then I sum it up with 0.1. So, I got 0.30 for the first calculation. When I do it multiple times until the value is 0.50. When I do the calculation for 0.5 (plus with 0.1 again), I got

How to get the most recent open position when using buy limit and buy stop?

I am implementing the EA with mql5. I would like to know how can I retrieve the most recent open position. As I am using buy limit and buy stop, it can't use the highest ticket number to refer to the latest open position. What function should I use? Could anyone please give any suggestion

Please Help - How to select order by ticket by using CTrade library

I'm trying to get open price from ticket number and I'm using CTrade library to open position. I can open the position with no problem, but I think I cannot select the openned position by the ticket I have. I have tried OrderSelect() function , but it return false with error code 4754 which mean

Wrong calculation of DEMA

(Sorry for my bad English) I try to calculate DEMA and I got wrong value when I compare the value of DEMA with this website (http://www.forexlive.com/LiveCharts). I have no idea about the reason that make my DEMA value different to DEMA value in the website. I want to calculate a DEMA value with