Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple "Custom Sessions"

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

    Multiple "Custom Sessions"

    I would like my strategy to trade 1 time in the morning and 1 time in the afternoon. I have figured out how to limit it to 1 time per session but cannot figure out how to set up two "custom sessions" (9:30am - 12:00pm and 12:00pm - 3:30pm) or another way to do this. You help is appreciated.

    GT

    #2
    Unfortunately this is not supported at this time. However, it's on our list for NT7 (first beta in Q1 09).

    Comment


      #3
      How about using something like this:

      in the OnBarUpdate section:

      if(DateTime.Now.Ticks == 093000)
      {
      bool longTraded = false;
      bool shortTraded = false;

      if(entryOrder == null && (ToTime(Time[0]) >= 093000 && ToTime(Time[0]) <= 120000) && long entry conditions met)
      entryOrder = EnterLongStop(1, Close[0]+ATR(14)[0], "LongEntry");

      if(entryOrder == null && (ToTime(Time[0]) >= 093000 && ToTime(Time[0]) <= 120000) && short entry conditions met)
      entryOrder = EnterShortStop(1, Close[0]-ATR(14)[0], "ShortEntry");
      }

      In the OnExecution(IExecution execution) section under the stop and limit orders putting: LongTraded = true

      Which would then not allow another trade until the original timeframe again. Also add another timeframe with longtraded2 = false. Would something like this work or am I way off? Thanks for the help!

      GT

      Comment


        #4
        GreenTrade,

        You can see this reference sample on time filters: http://www.ninjatrader-support2.com/...ead.php?t=3226

        Just create yourself two time filters and add yourself your two flag variables. Essentially the idea you have running right now. Unfortunately as Dierk stated though it is currently not supported.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        64 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Working...
        X