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 pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    149 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    5 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    5 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,283 views
    0 likes
    Last Post Leafcutter  
    Working...
    X