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

time at the close of bar plus 2 minutes in HH:mm format.

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

    time at the close of bar plus 2 minutes in HH:mm format.




    people with nt,


    i have been collaborating on a system to trade individual stock options automated. this system is almost finished and at the moment i am testing rolling positions over.


    to this end i need to create a variable (or variables) that will take the time at the close of the current bar only, add two minutes to this time and then return this new time as a string in HH:mm format.



    from other indicators i have created for nt i have this code below but i don't know if this will return the time in the desired HH:mm format and how could i add 2 minutes to this time.


    = string.Format(@"{0}", DateTime.Now.ToString("HH:mm"));



    i will greatly appreciate your assistance, i think this should be a really elementary piece of code to put together for advanced developers.



    very well, regards.

    #2
    Hello rtwave,

    The Time objects in NinjaScript are C# DateTime objects so you can use any standard DateTime functions like AddMinutes : https://docs.microsoft.com/en-us/dot...tframework-4.8

    Code:
    DateTime newTime = Time[0].AddMinutes(2);
    Then you can format the newTime variable however you waned like you have shown with ToString.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by rtwave View Post

      i have been collaborating on a system to trade individual stock options automated. this system is almost finished and at the moment i am testing rolling positions over.

      Hello rtwave

      I was reading some comments from you about algorithmic options trading, here in ninjatrader forum, in a couple threads.

      I'm starting to work in the topic of how to automate options, for both, options on ETFs/stocks and mainly for options on Futures, and I would like to ask you where I can find more information about these topics, because I'm seeing most platforms doesn't come with a built and ready-to-use way to automate options and about how to make backtests/optimizations for options automated strategies.

      I was reading your other post here:
      Hi, I'm assessing to develop an automated options trading system based obviously on its underlying's behavior. I imagine that if I knew in advance what option would I use, then I'd simply add that data series to submit orders. But I wonder this: Could I make a system that once is running the strategy on the underlying or


      and there you say that "...i have posted about this system on elite trader and other public fora and will post more extensively when i have the chance.", but I couldn't find those posts in Elite Trader, so I would like to ask you to share the links of those posts from Elite Trader and the other public forums, I don't know if maybe directly in the "github discussions section" for example.

      Well, in addition to what you've posted in the past in other forums, I will appreciate all the help you can provide about this topic.

      Thank you in advance!



      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Jimmyk, 01-26-2018, 05:19 AM
      6 responses
      835 views
      0 likes
      Last Post emuns
      by emuns
       
      Started by jxs_xrj, 01-12-2020, 09:49 AM
      6 responses
      3,291 views
      1 like
      Last Post jgualdronc  
      Started by Touch-Ups, Today, 10:36 AM
      0 responses
      11 views
      0 likes
      Last Post Touch-Ups  
      Started by geddyisodin, 04-25-2024, 05:20 AM
      11 responses
      62 views
      0 likes
      Last Post halgo_boulder  
      Started by Option Whisperer, Today, 09:55 AM
      0 responses
      9 views
      0 likes
      Last Post Option Whisperer  
      Working...
      X