Wrong profit

 

I'm using the 225 version, and I have found that sometimes MT is showing the wrong profit on a currently opened trade, just after opening a trade I can see either 0 or -1 (2 being the spread) in pips.

Even more, in my EA I calculate the profit from the actual order (it's not denominated in USD) :

currentProfit = MathRound( OrderProfit() / ( MarketInfo(tradeSymbol,MODE_TICKVALUE)*OrderLots() ) );

... but still, it reports exactly the same as MT in the open order tab. And, if I try to close the order at 0 reported profit for example, on the closed orders tab I get -2 pip loss, as supposed. It's quite annoying since being a scalper, every pip counts and I've lost a few trades that I shouldn't have.

Has anybody encountered this bug?

(And please don't tell me to upgrade to 226, I've checked already the if this bug is on the changes list ... My trading setup is a fragile ecosystem with lots of modules, and the upgrade is quite annoying, so I will do it if is really necessary)

 

MODE_TICKVALUE is based on the BID price of Symbol()...and depending on whether the account denomination is the base or counter currency of the resultant counter-pair then MODE_TICKVALUE depends on either the BID or the ASK price of the requisite cross-currency pair (wrt account's denomination).

This introduces systematic error in your order-profit computation if the value of your position is determined by the ask price (i.e. a short position) or if the corresponding cross-currency pair valuation is dependent on the ask price.

MODE_TICKVALUE is to be considered more as a guideline than an analytically precise value relevant to your specific market position. (this is true of required margin as well as leverage)

For most people the discrepancy is not any issue, however if you are attempting to account for every pip and every penny (as I do) then you need a more robust, and analytically correct, method opf computing your profits in the account's denomination.

 

Indeed, MODE_TICKVALUE changes every minute, and so the OrderProfit() which should be somewhat more reliable, but the changes are small ... I can accept that I made some mistake in the coding, but really now, even in the Open Orders Tab where the profit is shown in Points? That's an obvious MT bug.

Plus, even if is some error depending on where the MODE_TICKVALUE looks at (BID or ASK for the account base currency), the differences should be larger since the spread of my base account currency is about 150 pips (and not mini-pips).

So, for all this matters, I'm certain that to a point my method of calculating the profit is fine since it exactly the same as the MT is doing it.

And, a strange thing, the account in question is a live account, but, until going live, I had 500+ trades with this strategy on demo, and I didn't remember this happening then. I would have notice it since I'm watching every pip when trading. Weird.

Probably I will (reluctantly) change the profit calculation with a price based method (curentPrice-entryPrice).

So, nobody encountered this before?

 
csebastian:

in the Open Orders Tab where the profit is shown in Points?


I assume you know that you can right-click the profit in the orders tab to choose to display as a monetary value?

CB

 

Of course CB, it's kinda' obvious ... I wouldn't ask if I didn't consider to be a bug. Right after opening a trade, without any price movement, the Profits (As Points) it's shown to be 0. Of course can be zero if there is no spread, but when I close it, I hit a 2 pips loss, as it should be.

Maybe is something to do with the rapid price movement, just when the order confirmation arrives to the terminal, a 1-2 pips price movement arrives too and all the data get's mixed up. Dunno', it's just a guess ... probably it's a rare bug or something ...

 

I have often had trades opened at -2 pips too I used to think it was the spread and a normal part of trading but since I have been working on EA's and investigating the exact positions of open and close and how to maximise this I realised there was something not quite right about that.