Run code in nt7 at specific time each day - NinjaTrader | futures io social day trading
futures io futures trading


Run code in nt7 at specific time each day
Updated: Views / Replies:628 / 3
Created: by pxp333 Attachments:2

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
 

Run code in nt7 at specific time each day

  #1 (permalink)
Trading Apprentice
Parlin NJ/USA
 
Futures Experience: Advanced
Platform: Ninjatrader
Favorite Futures: NQ
 
Posts: 7 since Mar 2015
Thanks: 0 given, 0 received

Run code in nt7 at specific time each day

Hi All,

I have an automated strategy that works fine. The strategy requires that it's parameters be updated each day after the market close at 1715est. This calculation takes about 2 min to complete. Since I moved over to trading with ninja I have been running the calc each day at 1720est manually and then updating my strategy parameters before the market opens again at 1800est. I know that I can run this calc within onbarupdate but I would have to do it for every tick since ninja cannot know the last tick of the day until 1800est but then it's too late because I trade on the open at 1800est. But also because it takes about 2 min using onbarupdate it severely impacts the strategy's performance.

When I was trading with trade station I was able to use a simple timer event method outside of thier bar update method.
Where each day at 1720est my code would run even though the market was closed on thus my parameters got auto updated for me.

I still have the tradestaion code and maybe someone can translate it into ninja script?
I can supply it.

Can anyone show me how to trigger my calc at 1720est using nt7 outside of onbarupdate when the ES is closed M-F?

Thanks in advance.

Reply With Quote
 
  #2 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,337 since Dec 2012
Thanks: 11,277 given, 7,091 received


pxp333 View Post
Can anyone show me how to trigger my calc at 1720est using nt7 outside of onbarupdate when the ES is closed M-F?

The attached code should do what you're looking for, I've just built it as an indicator, you can convert it to strategy or whatever you want. Change, modify or extend the code as needed, put your specific code in the 'myDelayedCodeHandler' routine. NB the Windows.Forms line addition in declarations.

The run code request is reset on every new session and then only run when not loading historical data. It tests fine under MR tonight, note that it only uses 'Now' and not an MR/Time[0] time, you might want to do something different if you were backtesting or running under MR.

The run time is set in Properties, default is your 17:20, the timer runs free and checks every 5 secs, change it if needed, we could also only start it at the end of a session but that's just more code for not much gain. You could also just set the interval for a single shot amount instead, plenty of other ways too if the cat has a thicker skin.

Cheers

Travel Well
Attached Files
Register to download File Type: zip RunDelayedCode.zip (2.0 KB, 28 views)

Last edited by ratfink; May 23rd, 2015 at 08:01 PM.
Reply With Quote
 
  #3 (permalink)
Trading Apprentice
Parlin NJ/USA
 
Futures Experience: Advanced
Platform: Ninjatrader
Favorite Futures: NQ
 
Posts: 7 since Mar 2015
Thanks: 0 given, 0 received

Update This Code has been Developed


Hi RatFink,

I really appreciate that you answered my query.

I took some time and reviewed the code that you sent. There was probably a misunderstanding as to exactly what I needed. So your code was not able to run when the markets are closed such as today, Saturday. You can check this yourself by just setting the time to whenever before the markets reopen on Sunday, the code will not execute.

Anyhow what you showed me though was exactly what I was looking for because I was not that familiar with timer usage and the other special NT methods that you showed with your code.

I made an extensive rework of your code in both indicator and strategy forms. They have both been tested and you can test them yourself when the markets are closed. For instance set the time today, sat to say 22:00:00 and it will print out friday's last bar's high and your original message about place your code here. If you leave it running it will do it again each day at 22:00:00 in sync with your computer's clock.

Thanks again for helping me out this was an important part of my auto-trading that I just could not get my head around until now.

Attached are the exported NT7 Indicator and Strategy forms of this Timer Code for anyone that needs it. Just add it to your existing coding.DailyTimer.zip

Best Regards & Good Trading!

Reply With Quote
 
  #4 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,337 since Dec 2012
Thanks: 11,277 given, 7,091 received

Hi @pxp333, Yes that's fine, I had assumed you only wanted M-F and would have session starts accordingly, glad to have helped, Cheers.

Travel Well
Reply With Quote

Reply



futures io > > > > Run code in nt7 at specific time each day

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
Assign value to the close price at a specific time sunsun AmiBroker 2 March 3rd, 2015 03:15 PM
Display on chart a specific time period ctmvas NinjaTrader Programming 2 October 20th, 2013 08:39 PM
H/L FOR A SPECIFIC PERIOD OF TIME FKtrader NinjaTrader 2 October 20th, 2013 12:30 PM
How to cancel an order at a specific time sburtt NinjaTrader Programming 3 August 15th, 2013 02:58 AM
Price marker at specific time meyer99 NinjaTrader 5 July 22nd, 2011 08:04 PM


All times are GMT -4. The time now is 08:37 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-15 in 0.09 seconds with 20 queries on phoenix via your IP 54.234.247.118