Download MetaTrader 5

Scripts: Spread and Pip Cost Checker

To add comments, please log in or register
MQL5 library has more than 1500 apps already. Contribute your own one!
Automated-Trading
Admin
99085
Automated-Trading 2015.03.26 12:12 

Spread and Pip Cost Checker:

This script show you current currency pairs spread, pip value in your account currency and the total cost of the spread to open a position.

Fig. 3. Script output

Author: Mobarak Ali

chris4207
5
chris4207 2015.04.10 01:48  
I think the spread cost is off by 1 decimal place, along with the spread. In the example above, the spread is 8.4 pips, not 84 pips. and the cost should be 6.972 USD, not 69.72 USD. Not that big a deal though. Thanks for the script
Stuart Browne
5794
Stuart Browne 2015.04.10 02:11  

The pip value calculation is also not quite correct. It should be:

double PipValue=(((MarketInfo(Symbol(),MODE_TICKVALUE)*point)/MarketInfo(Symbol(),MODE_TICKSIZE))*LotSize);

point is calculated based on 4 or 5 digit broker:

   point=Point;
   if((Digits==3) || (Digits==5))
     {
      point*=10;
     }

 

Which will also stop the problem Chris had above.

Besides that, thanks for the script mate :) 

Mobarak Ali
6349
Mobarak Ali 2015.04.10 03:02  
chris4207:
I think the spread cost is off by 1 decimal place, along with the spread. In the example above, the spread is 8.4 pips, not 84 pips. and the cost should be 6.972 USD, not 69.72 USD. Not that big a deal though. Thanks for the script

Hi Chris,

I take that screenshot when market was close. That's why spread was high.

I think now you get it.

Mobarak Ali
6349
Mobarak Ali 2015.04.10 03:04  
Filter:

The pip value calculation is also not quite correct. It should be:

point is calculated based on 4 or 5 digit broker:

 

Which will also stop the problem Chris had above.

Besides that, thanks for the script mate :) 

Hi Filter,

It's open source script. Why you don't check the script.

I am sure in this script you can't find out any wrong.

Stuart Browne
5794
Stuart Browne 2015.04.10 03:34  
No problem, just trying to help you out. Up to you if you want to fix it or not

Cheers
mansk
10
mansk 2015.04.24 09:34  

To the next version, I think if you add the volume to the chart, can help to remember for wich volume is the cost information.

 Thanks for this script. 

Alain Verleyen
Moderator
30704
Alain Verleyen 2015.04.24 20:42  
Mobarak:

Hi Filter,

It's open source script. Why you don't check the script.

I am sure in this script you can't find out any wrong.

Of course it's buggy, it only works on some trading environments, not all.

I suggest you to read and understand constructive remarks from Filter.

Mobarak Ali
6349
Mobarak Ali 2015.05.07 16:31  

Thanks for your support. Bug fixed!

Eddy Cronen
7
Eddy Cronen 2015.09.07 05:20  

Hello, 

 

Thanks for this Indicator, but...it's possible isn't working now?

Best Regards. 

Pierre
61
Pierre 2016.01.13 22:34  

I have nothing showing on screen, won't even load. 

Any Ideas?

Regards. 

To add comments, please log in or register