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 selu72, Today, 02:01 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by WHICKED, Today, 02:02 PM
    2 responses
    8 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by f.saeidi, Today, 12:14 PM
    8 responses
    21 views
    0 likes
    Last Post f.saeidi  
    Started by Mikey_, 03-23-2024, 05:59 PM
    3 responses
    50 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Started by Russ Moreland, Today, 12:54 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X