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 benmarkal, Yesterday, 12:52 PM
    3 responses
    22 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by helpwanted, Today, 03:06 AM
    1 response
    18 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    11 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    6 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    244 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Working...
    X