DateTime comparison to fixed values - futures io
futures io futures trading



DateTime comparison to fixed values


Discussion in EasyLanguage Programming

Updated
    1. trending_up 507 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

DateTime comparison to fixed values

(login for full post details)
  #1 (permalink)
Encinitas
 
 
Posts: 4 since Jan 2019
Thanks: 0 given, 0 received

Suppose I only want my EL strategy to trade between two fixed times. In PST these times are 0630 and 1245. How do I compare the current time to these values?

My current code:

Inputs:
TimeBegin(630),
TimeEnd(1245);

if CurrentTime > TimeBegin and CurrentTime < TimeEnd then begin
{ trade logic here}
end
else begin
{no trading}
end;

Will this work or must I somehow convert CurrentTime to an integer? For BeginTime, must I specifiy it as 0630 rather that 630?

Please explain. Thanks.

Reply With Quote

Can you help answer these questions
from other members on futures io?
Indicators for pair trading MES and M2K
Platforms and Indicators
Help Needed: TOS Options Chain IV & IMPL MOVE Calcul …
ThinkOrSwim
Work with historical tcks data on MUltichart NET PowerLa …
MultiCharts
MACD line not plotting after change of plot order
NinjaTrader
If ES tracks SPX, why do support/resistance, Level 2, vo …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
108 thanks
Battlestations: Show us your trading desks!
99 thanks
Rank your Futures vs Stocks trading priority
54 thanks
Want your NinjaTrader indicator created, free?
26 thanks
Whats this confusion with margins?
23 thanks
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


westofpluto,

CurrentTime is your computers clock at this very moment, using the reserved word Time that gives you the time of the bar might be better suited for your purpose.
A conversion wouldn't be necessary and using 0630 or 630 should make no difference.

Regards,

ABCTG

Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > DateTime comparison to fixed values


Last Updated on January 28, 2019


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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