How to get last two decimals of ask or bid in c++?

How to create strategies and indicators
Message
Author
George
Posts: 4
Joined: Mon Sep 09, 2013 9:35 am

How to get last two decimals of ask or bid in c++?

#1 Postby George » Wed Sep 18, 2013 9:44 am

I have a strategy where I place buy and sell orders based on the 50 and 00 of the eur/usd. So I need to capture when ask or bid moves past a 50 or 00 for example if price is below 1.3140 and crosses 1.3150 I want to place orders. I just do not know how to capture the "50" of 1.3150 :)

Thanks for you help!

FX Helper
Posts: 1479
Joined: Mon Apr 01, 2013 3:55 am

#2 Postby FX Helper » Wed Sep 18, 2013 10:09 am

Hello,

I think, (modf(price)*10000)%100 will give you two last numbers of the price for 4 digit price.

If price is 5-digit then it will be (modf(price)*100000)%1000 and you will get 3 digits.

George
Posts: 4
Joined: Mon Sep 09, 2013 9:35 am

#3 Postby George » Wed Sep 18, 2013 10:20 am

I will try that .. thank you :)


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 19 guests