• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjascript - Time between two bars

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

    Ninjascript - Time between two bars

    Hi,

    I have this rule in my strategy where i want to make sure at least there is 3 seconds between bar number 1 and 3, the idea is to avoid trading during erratic moves. It doesn't seem to be working, any idea why?


    && ToTime(Time[1])-ToTime(Time[3])>3

    thanks
    M

    #2
    You can use Time[1].Subtract(Time[3]).TotalSeconds > 3 instead.

    Comment


      #3
      seems to be working, thank you

      Comment


        #4
        Hello mntemel,

        Thank you for your post.

        You may find this example from our help guide of assistance for some pointers on manipulating DateTime objects as well:

        https://ninjatrader.com/support/help...me_objects.htm

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by nctpar, Yesterday, 02:13 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by webus, Today, 12:02 AM
        0 responses
        2 views
        0 likes
        Last Post webus
        by webus
         
        Started by jeronymite, Yesterday, 09:26 PM
        0 responses
        6 views
        0 likes
        Last Post jeronymite  
        Started by ttodua, 08-08-2020, 06:45 AM
        2 responses
        17 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by franco12364, Yesterday, 08:08 PM
        2 responses
        11 views
        0 likes
        Last Post franco12364  
        Working...
        X