Stuck with a simple function: Return true if time between 8pm and 1 am - EasyLanguage Programming | futures io social day trading
futures io futures trading


Stuck with a simple function: Return true if time between 8pm and 1 am
Updated: Views / Replies:876 / 4
Created: by arjfca 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 90,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

Reply
 
Thread Tools Search this Thread
 

Stuck with a simple function: Return true if time between 8pm and 1 am

  #1 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: Interactive Broker
Favorite Futures: Forex
 
Posts: 262 since Sep 2010
Thanks: 436 given, 86 received

Stuck with a simple function: Return true if time between 8pm and 1 am

Hello

I'm stuck with a simple function to return true a function ( Asia) if time is between 8 pm and 1 am ( Asia session).

Any help appreciated

MT

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Trading for Fun
London
 
Futures Experience: None
Platform: mc, TS, ninja
Favorite Futures: es
 
Bimi's Avatar
 
Posts: 118 since Mar 2010
Thanks: 42 given, 58 received



arjfca View Post
Hello

I'm stuck with a simple function to return true a function ( Asia) if time is between 8 pm and 1 am ( Asia session).

Any help appreciated

MT

Why stuck?

Reply With Quote
 
  #4 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


arjfca View Post
I'm stuck with a simple function to return true a function ( Asia) if time is between 8 pm and 1 am ( Asia session).

Try rephrasing your problem: returning false when the time is after 1 am but before 8 pm. Then it's relatively easy to see the answer:
 
Code
if (Time_s > 1000) and (Time_s < 20000) then 
	false
else
	true;
Or a more complex solution (untested):

 
Code
Variables:
	eightPM(ELTimeToDateTime(2000)),
	oneAM(ELTimeToDateTime(100)),
	timeNow(0);
	
timeNow = ELTimeToDateTime_s(Time_s); 	// or CurrentTime_s with RecalcLastBarAfter if instrument is slow

if (timeNow >= eightPM) and (timeNow <= oneAM) then
	true
else
	false;
Or did I misunderstand you?

Reply With Quote
The following 3 users say Thank You to Jura for this post:
 
  #5 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: Interactive Broker
Favorite Futures: Forex
 
Posts: 262 since Sep 2010
Thanks: 436 given, 86 received


Jura View Post
Try rephrasing your problem: returning false when the time is after 1 am but before 8 pm. Then it's relatively easy to see the answer:
 
Code
if (Time_s > 1000) and (Time_s < 20000) then 
	false
else
	true;
Or a more complex solution (untested):

 
Code
Variables:
	eightPM(ELTimeToDateTime(2000)),
	oneAM(ELTimeToDateTime(100)),
	timeNow(0);
	
timeNow = ELTimeToDateTime_s(Time_s); 	// or CurrentTime_s with RecalcLastBarAfter if instrument is slow

if (timeNow >= eightPM) and (timeNow <= oneAM) then
	true
else
	false;
Or did I misunderstand you?

Thanks

Solution was so simple that I'm shy

 
Code
// Return true if asia session is on

If time_S >= 200000 or time_S <= 10000 then 
Asia = True
else
Asia = False;
I was looking for a solution that include two date since the laps time was having both legs on two day. User TJ on MC forum provided me the solution. I have Thousands of codes line written and I was stuck with this one

Martin

Reply With Quote

Reply



futures io > > > > > Stuck with a simple function: Return true if time between 8pm and 1 am

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
STUCK LIMIT ORDER ShruggedAtlas NinjaTrader 3 September 8th, 2011 10:29 PM
Time Bandits. A Simple Trading Plan for the E mini Dow YM BroncoSlade Emini Index Futures Trading 37 July 8th, 2011 11:09 AM
Stuck on FN key timmyb Tech Support 1 January 24th, 2011 02:52 PM
True High and True Low kaywai NinjaTrader Programming 4 January 20th, 2010 04:09 PM
Chart Stuck on my last trade alpine4133 Traders Hideout 2 September 3rd, 2009 08:13 AM


All times are GMT -4. The time now is 11:32 AM.

Copyright © 2017 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
Page generated 2017-12-11 in 0.09 seconds with 19 queries on phoenix via your IP 54.82.81.154