Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Pip Value on Micro Futures #10

Closed
GitHubTrader opened this issue Feb 10, 2021 · 8 comments
Closed

Incorrect Pip Value on Micro Futures #10

GitHubTrader opened this issue Feb 10, 2021 · 8 comments

Comments

@GitHubTrader
Copy link

GitHubTrader commented Feb 10, 2021

Hello,

In version 2.27 this worked correctly in version 2.33 the Pip Value is wrong. I'm not much of a coder but I am trying to find the difference or what changed to make this happen, so if I find I'll post again. If someone has time to look into this it would be appreciated.

I've included screen shots showing the difference. The left side is the correct Pip value. I also imagine this may mess up the SL/TP on futures like S&P and Nasdaq as the SL/TP has to be set at .25 levels. I haven't tested to see if the SL/TP is properly place as of yet.

This is MT5 with Futures broker ampfutures

v227_v233_01

v227_v233_02

@EarnForex
Copy link
Owner

Hi!

Thanks for reporting the issue!
Unfortunately, I cannot test this as AMP Futures wouldn't send me the confirmation email to open an account. Would it be possible for you to open another demo account there and send me the credentials (to webmaster@earnforex.com)?

@GitHubTrader
Copy link
Author

GitHubTrader commented Feb 11, 2021 via email

@EarnForex
Copy link
Owner

What's the email address I can send you my phone number to?

@GitHubTrader
Copy link
Author

GitHubTrader commented Feb 11, 2021 via email

@GitHubTrader
Copy link
Author

GitHubTrader commented Feb 11, 2021 via email

@EarnForex
Copy link
Owner

OK, thanks to @GitHubTrader I now have a working demo account.
I've looked into the issue with incorrect pip value and position size calculation. It seems, the problem is caused by either incorrect return of the TickValue for this symbols from the trading server or by incorrect MQL5 documentation on the calculation method (I don't remember if I tested Exchange Futures symbols with any other brokers). Most likely, it is the former as the TickValue right now returns 0.5, while this symbol is a $5 futures where $1 movement in the underlying index should cost $5.

Anyway, a rough fix can be applied by replacing line 5019 in PositionSizeCalculator.mqh:
if ((CalcMode == SYMBOL_CALC_MODE_FUTURES) || (CalcMode == SYMBOL_CALC_MODE_EXCH_FUTURES) || (CalcMode == SYMBOL_CALC_MODE_EXCH_FUTURES_FORTS))
with:
if ((CalcMode == SYMBOL_CALC_MODE_FUTURES) /*|| (CalcMode == SYMBOL_CALC_MODE_EXCH_FUTURES)*/ || (CalcMode == SYMBOL_CALC_MODE_EXCH_FUTURES_FORTS))

I will later look into the issue with the spread.

@EarnForex
Copy link
Owner

OK, I've looked into the spread issue, and it doesn't seem incorrect to me. The spread is calculated as Ask - Bid, which is exactly 25 points here:
spread

Please let me know if I am missing something.

@EarnForex
Copy link
Owner

Solved in 2.34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants