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 martin70, 03-24-2023, 04:58 AM
    15 responses
    114 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by The_Sec, Today, 02:29 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by jeronymite, 04-12-2024, 04:26 PM
    2 responses
    31 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by Mindset, 05-06-2023, 09:03 PM
    10 responses
    265 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by michi08, 10-05-2018, 09:31 AM
    5 responses
    743 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X