Days Between Orders

Post Reply
User avatar
OmarSM
Trader
Posts: 10
Joined: Wed Nov 16, 2011 12:48 pm

Days Between Orders

Post by OmarSM »

Hi,

Please help coding the days between two orders.

I can't help myself around this. :arrrg: I can find the dates, but don't know how to add/subtract to other dates and finally get the number of days between them.

Thanks in advance for the help.

Omar
"Never Give Up, Never Surrender"
afeudale
Trader
Posts: 59
Joined: Mon Aug 08, 2016 1:23 pm

Days Between Orders

Post by afeudale »

OmarSM » Wed Dec 07, 2016 11:13 am wrote:Hi,

Please help coding the days between two orders.

I can't help myself around this. :arrrg: I can find the dates, but don't know how to add/subtract to other dates and finally get the number of days between them.

Thanks in advance for the help.

Omar
Hi Omar,

How about if you get the dates as an integer instead of datetime? Then the values will be in seconds. You can subtract one from the other and divide by 86,400 (seconds in a day) to get the number of days? Then you can MathRound or other Normalize function if you want a whole number.
User avatar
OmarSM
Trader
Posts: 10
Joined: Wed Nov 16, 2011 12:48 pm

Days Between Orders

Post by OmarSM »

afeudale » Wed Dec 07, 2016 12:59 pm wrote:
OmarSM » Wed Dec 07, 2016 11:13 am wrote: Hi Omar,

How about if you get the dates as an integer instead of datetime? Then the values will be in seconds. You can subtract one from the other and divide by 86,400 (seconds in a day) to get the number of days? Then you can MathRound or other Normalize function if you want a whole number.
:good:
Thanks for the tips, Got it working!!
"Never Give Up, Never Surrender"
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Days Between Orders

Post by SteveHopwood »

OmarSM » Fri Dec 09, 2016 3:53 pm wrote:
:good:
Thanks for the tips, Got it working!!
Did you avoid those, "possible loss of data due to type conversion" warnings? The answer is 'Yes' if you haven't a clue what I am talking about and I will explain.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Post Reply

Return to “Coders Hangout”