Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

timebomb code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    timebomb code

    Hi,

    I am going to be sending an indicator out to 150 people, its for a small tutorial I am putting together, I would like to add a timebomb to the code so it will not run after the week is finished.

    I dont want to ask for Machine ID's I just want it to work on any machine up to a certain date.

    How can I hard code this in Ninjascript plz?

    Thanks

    #2
    Hello lucyjoy,

    Thanks for your question.

    You would not be able to use Disable() with a NinjaTrader 7 indicator, so I would suggest to use a time check to check DateTime.Now and simply call return.

    For example:

    Code:
    protected override void OnBarUpdate()
    {
    	if (ToDay(DateTime.Now) > 20170613)
    		return;
    }
    As this would just blindly prevent the indicator from working, I would suggest to add an alert as well.

    Alerts - https://ninjatrader.com/support/help.../nt7/alert.htm

    ToTime() - https://ninjatrader.com/support/help...nt7/totime.htm

    Please let me know if I can be of further help.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by StrongLikeBull, Yesterday, 04:05 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Mestor, 03-10-2023, 01:50 AM
    14 responses
    375 views
    0 likes
    Last Post z.franck  
    Started by molecool, 10-09-2017, 10:48 AM
    5 responses
    1,621 views
    0 likes
    Last Post trader-ap  
    Started by The_Sec, Yesterday, 03:53 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by mmenigma, Yesterday, 03:25 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X