Adding minutes to an hour in easylanguage - TradeStation | futures io social day trading
futures io futures trading

Adding minutes to an hour in easylanguage
Updated: Views / Replies:1,858 / 3
Created: by onava Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

Adding minutes to an hour in easylanguage

  #1 (permalink)
Trading Apprentice
London/England, Zurich/Switzerland
Trading Experience: None
Platform: all
Favorite Futures: Tambourine
Posts: 20 since Apr 2012
Thanks: 2 given, 1 received

Adding minutes to an hour in easylanguage

HI All,

Im trying to join a minutes parm with an hour par, For example. i want to join 1600 with 43 minutes = 1643 and use it as a parm. does anyone know how to do this.( i dont have the calctime function by the way)

many thanks

Reply With Quote
  #2 (permalink)
Elite Member
Dartmouth NS
Trading Experience: Intermediate
Platform: MC, MC.Net, NT, TWS
Broker/Data: IB / IQFeed / Kids
Favorite Futures: Forex, stocks
bnichols's Avatar
Posts: 638 since Feb 2010
Thanks: 64 given, 460 received

In PowerLanguage (knock off of EasyLanguage) I treat times as natural numbers (positive integers), so that if

Hours = 16


Minutes = 43


a time of 1643 becomes myTime = Hours*100 + Minutes.

Converting a time of 1643 to minutes, say,

value1 = intportion(myTime/100);
myMinutes = value1*60 +(myTime - value1*100);

Functions that use times (e.g. to place drawing objects) or convert to "ticks since some datum" don't seem to mind.

Last edited by bnichols; February 19th, 2013 at 11:59 AM.
Reply With Quote
  #3 (permalink)
Elite Member
Chicago, IL USA
Trading Experience: Intermediate
Platform: MultiCharts + CTS T4
Broker/Data: Advantage Futures,
Favorite Futures: YM, ES, EU, US, S
furytrader's Avatar
Posts: 153 since Jun 2011
Thanks: 109 given, 145 received

This post has been selected as an answer to the original posters question Answer

A few years ago, I wrote the following EasyLanguage function called "addMinutes":

Inputs: RefTime(numeric),RefMinutesToAdd(numeric);

Vars: vOriginalMinutes(0), vOriginalHours(0);
Vars: vTestMinutes(0);
Vars: vTempMinutes(0), vTempHours(0);
Vars: vNewMinutes(0), vNewHours(0);

vOriginalHours = IntPortion(RefTime/100);
vOriginalMinutes = Mod(RefTime,100);

vTestMinutes = vOriginalMinutes + RefMinutesToAdd;

If vTestMinutes <= 59 Then Begin 
   vNewMinutes = vTestMinutes;
   vNewHours = vOriginalHours;

If vTestMinutes > 59 Then Begin 
   vTempMinutes = Mod(vTestMinutes,60);
   vTempHours = IntPortion(vTestMinutes/60);

   vNewMinutes = vTempMinutes;

   If vNewMinutes > 59 Then Begin 
      vNewMinutes = vNewMinutes - 60;
      vTempHours = vTempHours + 1;

   vNewHours = vOriginalHours + vTempHours;
   If vNewHours > 23 Then vNewHours = vNewHours - 24;


AddMinutes = (vNewHours * 100) + vNewMinutes;
It takes as its inputs the original time (in standard EL military time format) and the number of minutes you want to add and returns the new time.

I think there are easier ways in EasyLanguage to do this ... but this works for me!

Reply With Quote
The following user says Thank You to furytrader for this post:
  #4 (permalink)
Trading Apprentice
Fort Collins, CO, United States
Trading Experience: Advanced
Platform: Tradestation, MT4
Favorite Futures: forex
Posts: 2 since Oct 2012
Thanks: 0 given, 1 received

This post has been selected as an answer to the original posters question Answer

TS has CalcTime(RefTime, MinuteChange) to do this.

And the code is trivially simple:

CalcTime = MinutesToTime( TimeToMinutes( RefTime ) + MinuteChange ) ;

Reply With Quote


futures io > > > > Adding minutes to an hour in easylanguage

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

Journal Challenge $1600 in Prizes & Free Journalytix for all participants!


Trading Resolutions for 2019 - Avoiding Mistakes w/GFF Brokers

Feb 19

3 Excellent Entries, and How To Automate Them w/Kevin Davey

Feb 21

The Driving Force Behind the Market w/Earn2Trade

Mar 5

TBA w/Stage5 & iSystems

Mar 12

TBA w/John Grady @ No BS Day Trading

Mar 19

Day Trading Oil Futures: Reducing Risk & Increasing Profits w/DTN IQFeed

Mar 26

Similar Threads
Thread Thread Starter Forum Replies Last Post
draw rectangle for first hour of market indicator ceramictilepro NinjaTrader Programming 3 August 10th, 2012 03:26 PM
4 Hour Charts Market Sniper 88 Emini Index Futures Trading 2 June 18th, 2012 11:34 AM
Previous Hour High and Low times in easylanguage onava TradeStation 3 April 26th, 2012 02:02 PM
Hour Bars JustWondering Traders Hideout 3 December 10th, 2010 07:36 PM
Same condition every hour rajafx1 NinjaTrader Programming 5 August 13th, 2010 06:43 AM

code, easylanguage, el, es, how to, powerlanguage, tradestation

All times are GMT -4. The time now is 01:21 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business,
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2019-02-17 in 0.18 seconds with 22 queries on phoenix