Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Don't Trade" Periods

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

    "Don't Trade" Periods

    Hi there,

    Is there an option in the strategy setup to "not trade"?
    For example, in my strategy I don't want to trade during 20:00 and 06:30.
    Please let me know how I can program this in.

    Thx,

    Z

    #2
    Originally posted by Zhorny View Post
    Hi there,

    Is there an option in the strategy setup to "not trade"?
    For example, in my strategy I don't want to trade during 20:00 and 06:30.
    Please let me know how I can program this in.

    Thx,

    Z
    Hi Zhorny,

    You mean something like ToTime()?

    Regards,

    Comment


      #3
      Possibly yes. Does this mean you're strategy will only trade between certain times?
      How can I access this in the GUI Strategy drop down menus?

      Comment


        #4
        Unfortunately you could not access those directly, a time filter example is shown here -

        Comment


          #5
          Great thanks.

          I've installed it and it comes up with the SampleTimeFilter example under the "edit ninjascript" > "strategy" menu but how can I implement it?

          Do I have to hard code it in or can I access it via the GUI?

          Comment


            #6
            This would be an example how to hardcode the start / end times in, but you can replace the times set with user inputs of DateTime for example.

            Or in the wizard those rules can also be setup without any programming -

            Comment


              #7
              Thanks Bertand. Is it something like this (see below)?
              Example, flatten position after 1900 and before 0630 (although I tried it and it didn't seem to work).

              Comment


                #8
                You're welcome, this will not work, as you do not have any action specified, only conditions that would trigger the below listed action...which is empty here in your case.

                Comment


                  #9
                  Hmmm ok. I read the website you sent me to and I understand it (or so I think) but still stuck on how I would want to limit trading sessions.
                  You mentioned DateTime - how can I get around programming specifics in?

                  Comment


                    #10
                    Here's a simple example to demonstrate, it would go long only if flat and if the bar time in in the cash hours from 9:30 to 16:00...and then exit at the close as defined by the session template used.
                    Attached Files

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    633 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    364 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    105 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    567 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    568 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X