How to use Mode_Spread????

 

How do you use Mode_Spread? No matter which currency I run it on, it always returns a value of 13. (It is .13 for 2 decimal currencies and .0013 for 4 decimal currencies. I want to compensate my entry price for the currency using mode spread instead having to use CASE statements. I must be missing something simple. Can anyone help me out?

 
tak145:
How do you use Mode_Spread? No matter which currency I run it on, it always returns a value of 13. (It is .13 for 2 decimal currencies and .0013 for 4 decimal currencies. I want to compensate my entry price for the currency using mode spread instead having to use CASE statements. I must be missing something simple. Can anyone help me out?

It depends on what you are putting as the first parameter of the MarketInfo() function. What are you putting in there?

There is of course a simple way around this function:

Ask-Bid;

That will give you the spread also. Or in terms of the Markinfo function:

double spread = MarketInfo(Symbol(), MODE_ASK) - MarketInfo(Symbol(), MODE_BID);
 

Thanks.

My programming partner also said to use Ask-Bid but I wanted to know how mode spread works. I was not using it properly with Market Info. Thanks for the help!!!