Download MetaTrader 5

TickSize = 0 ???

To add comments, please log in or register
What is the best place to find a programmer? Freelance service!
BambooDrum
11
BambooDrum 2015.03.14 13:45 

OK Here's my problem:

I create a double on the global scope called   TickSize

Then in the Oninit function I put...   TickSize = MarketInfo(Symbol(),MODE_TICKSIZE); 

The EA complains that this is zero and it is messing with the division. I print it and sure enough it is    0   No Decimal points just    0

 MarketInfo(Symbol(),MODE_TICKSIZE)*1000000  is worth 10 strangely enough!

I have tried Normalizing it ,but no matter what I do, it is just 0. Apart from assuming it is 0.00001 and hardcoding it, how do I get to 0.00001 ?

Any help would be much appreciated right now.

BambooDrum
11
BambooDrum 2015.03.14 17:14  
BambooDrum:

OK Here's my problem:

I create a double on the global scope called   TickSize

Then in the Oninit function I put...   TickSize = MarketInfo(Symbol(),MODE_TICKSIZE); 

The EA complains that this is zero and it is messing with the division. I print it and sure enough it is    0   No Decimal points just    0

 MarketInfo(Symbol(),MODE_TICKSIZE)*1000000  is worth 10 strangely enough!

I have tried Normalizing it ,but no matter what I do, it is just 0. Apart from assuming it is 0.00001 and hardcoding it, how do I get to 0.00001 ?

Any help would be much appreciated right now.

Actually I can write TickSize = 0.00001; and even this is said to be 0 with a print statement on the next line.   Yes, Ticksize definitely is a double and the start function is virtually all Commented out.

Are small numbers not allowed? 

Alain Verleyen
Moderator
30723
Alain Verleyen 2015.03.14 17:24  
BambooDrum:

Actually I can write TickSize = 0.00001; and even this is said to be 0 with a print statement on the next line.   Yes, Ticksize definitely is a double and the start function is virtually all Commented out.

Are small numbers not allowed? 

Show your code.
BambooDrum
11
BambooDrum 2015.03.16 18:53  
angevoyageur:
Show your code.

Thanks angevoyageur 

Well this is embarrassing. I think (not sure now) what happened, is that an integer was made out of a double after a bit of multiplication and what not . But it all works now anyway.

Not to worry Perhaps now we have a thread that is a bit useless though - Oops 

To add comments, please log in or register