Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ToTime(Time[0])

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

    ToTime(Time[0])

    Why

    if (ToTime(Time[0]) >= 075500 && ToTime(Time[0]) <= 080500)
    {....}

    is not compilate

    Time [0] is the current time ?

    #2
    Hello Pcomm69,
    Time[0] is the time stamp of the last/current bar.


    To assist you further may I know are you not able to compile your code or the condition is not being fulfilled. Also please let me know, what is the periodicity of the chart (on which you have applied the NinjaScript code.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thanks

      I mistake
      I reformulate my question

      How can I obtain the absolute instant time in second ?

      Comment


        #4
        Hello Pcomm69,
        Please use the below code to get the total seconds.
        Code:
        Time[0].TimeOfDay.TotalSeconds
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I am so sorry but i can't compile

          Private double Ess;
          .......
          Ess= Time[0].TimeOfDay.TotalSeconds;

          please give me an example

          Comment


            #6
            Hello Pcomm69,
            Instead of using

            Code:
            [B][COLOR="Red"]P[/COLOR][/B]rivate double Ess;
            Please use the below code


            Code:
            [B][COLOR="Green"]p[/COLOR][/B]rivate double Ess;
            Please let me know if you can compile now or not.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              pffffffffffffffffff i know
              it is a mistake fingers on keyboard

              I am so sorry but i can't compile

              private double Ess;
              .......
              Ess= Time[0].TimeOfDay.TotalSeconds;

              please give me an example

              Comment


                #8
                Hello Pcomm69,
                The code is working fine at my end.

                Can you send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com

                Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

                I look forward to assisting you further.

                *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  In despite

                  in despite

                  I have all re-key (refrappe)

                  all go done

                  may be a invisible caracter

                  i am so sorry

                  THANKS

                  Comment


                    #10
                    Hello Pcomm69,
                    Glad to know everything is working fine at your end.

                    Please let me know if I can assist you any further.
                    JoydeepNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    649 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    370 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    109 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    573 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    576 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X