if TODAY (only) - NinjaTrader Programming | futures io social day trading
futures io futures trading


if TODAY (only)
Updated: Views / Replies:2,889 / 23
Created: by SARdynamite Attachments:1

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
 1  
 
Thread Tools Search this Thread
 

if TODAY (only)

  #11 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 received

Historical is really used to discern between historical quotes and live quotes, not really for "today".

If you are checking bar data, you do the following:

if (Time[0].Date == DateTime.Now.Date) ....

Reply With Quote
The following user says Thank You to aslan for this post:
 
  #12 (permalink)
Elite Member
Belgium
 
Futures Experience: Advanced
Platform: SaxoTrader
Broker/Data: SaxoBank
Favorite Futures: ESTX
 
Posts: 290 since Dec 2009
Thanks: 242 given, 109 received

Thanks for the explanations. It now works like a charm.

Is there a way to code just the same but for YESTERDAY or say DAY-2 (only) ?

Reply With Quote
 
  #13 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


for yesterday you can use:

 
Code
                            
if (Time[0].Date == DateTime.Now.AddDays(-1).Date) ... 

-> but you might run into trouble with weekends and holidays



SARdynamite View Post
Thanks for the explanations. It now works like a charm.

Is there a way to code just the same but for YESTERDAY or say DAY-2 (only) ?



Last edited by Fat Tails; July 14th, 2010 at 08:14 PM.
Reply With Quote
 
  #14 (permalink)
Elite Member
Belgium
 
Futures Experience: Advanced
Platform: SaxoTrader
Broker/Data: SaxoBank
Favorite Futures: ESTX
 
Posts: 290 since Dec 2009
Thanks: 242 given, 109 received

Thanks.

Yeah the goal is to avoid daybreaks to move back in time only for real trading sessions.

I did not look at your sessionPivots indicator yet (actually, just a bit and it is very complete) but it seems to me that cory with his "ADR_cory" indicator already programmed that.

Now, I'll have to dig into it enough because it's not sweet candy for my brain.

Attached Files
Register to download File Type: cs ADR_Cory.cs (12.8 KB, 15 views)
Reply With Quote
 
  #15 (permalink)
Elite Member
Belgium
 
Futures Experience: Advanced
Platform: SaxoTrader
Broker/Data: SaxoBank
Favorite Futures: ESTX
 
Posts: 290 since Dec 2009
Thanks: 242 given, 109 received

Actually not, it does not seem to exclude day breaks neither.

Reply With Quote
 
  #16 (permalink)
 Vendor: www.probabletrades.com 
OC, California, USA
 
Futures Experience: Advanced
Platform: IB/TWS, NinjaTrader, thinkorswim
Favorite Futures: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,860 since Jun 2009
Thanks: 480 given, 3,255 received

All of my strats have this

 
Code
private DateTime Now { get { if (Historical) return Time[0]; else return DateTime.Now; } }
So in OnBarUpdate() I just use "Now" and it'll work for backtesting and real-time trading. For example, if I want to only trade between 9:30 am (930) and 1:15 pm (1315)

 
Code
if (ToTime(Now)/100 >= 930 && ToTime(Now)/100 <= 1315)
    trade();
Or, if I do NOT want to trade between 10:15 and 10:45 every Wednesday because of oil inventory reports I would

 
Code
if (ToTime(Now)/100 >= 1015 && ToTime(Now)/100 <= 1045 && Now.DayOfWeek == DayOfWeek.Wednesday)
    dontTrade();

Reply With Quote
The following 3 users say Thank You to shodson for this post:
 
  #17 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,220 since Jun 2009
Thanks: 628 given, 6,318 received
Forum Reputation: Legendary


SARdynamite View Post
Actually not, it does not seem to exclude day breaks neither.

it calculates the days with data only.

Reply With Quote
 
  #18 (permalink)
Elite Member
Belgium
 
Futures Experience: Advanced
Platform: SaxoTrader
Broker/Data: SaxoBank
Favorite Futures: ESTX
 
Posts: 290 since Dec 2009
Thanks: 242 given, 109 received

Really ? So you can tell it to examine only 3 or 5 session days back ? (excluding weekends, holidays, misc closed days)

I read on your parameters description that it would include Saturdays and Sundays so I'm a bit lost.

Reply With Quote
 
  #19 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,220 since Jun 2009
Thanks: 628 given, 6,318 received
Forum Reputation: Legendary


SARdynamite View Post
Really ? So you can tell it to examine only 3 or 5 session days back ? (excluding daybreaks)

I read on your parameters description that it would include Saturdays and Sundays so I'm a bit lost.

you read it from a programmer stand point. My comment is for a regular user when they want 5 days back they may not realize there is no data on Sat. and depending on the session time they may not even have data on Sun. Thus 5 days to them could be = 3 days with data.

Reply With Quote
 
  #20 (permalink)
Elite Member
Belgium
 
Futures Experience: Advanced
Platform: SaxoTrader
Broker/Data: SaxoBank
Favorite Futures: ESTX
 
Posts: 290 since Dec 2009
Thanks: 242 given, 109 received


Understood.

So could you be able to exclude non data days ? i.e. if it is set to 5, then take the last 5 sessions with data (skipping holidays, weekends, etc)

If you have the code for this by hand easily, I'd be really grateful if you can isolate it and share it. It's not that easy to navigate through someone else's code.

This way I can finish an idea of an overall indicator framing volatility (I have 2-3 ideas to include)

Reply With Quote

Reply



futures io > > > > > if TODAY (only)

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
CL trades today Saroj Trading Journals 3 May 9th, 2013 04:57 PM
went shopping today kbit Jokes 1 June 17th, 2011 02:42 AM
Today's ES context cleon Emini Index Futures Trading 1 April 8th, 2011 11:42 AM
Buy on Close(Today) Mondrakete NinjaTrader Programming 4 March 2nd, 2011 09:19 PM


All times are GMT -4. The time now is 01:02 PM.

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-16 in 0.12 seconds with 20 queries on phoenix via your IP 54.91.38.173