Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

working with multiple time frames

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

    working with multiple time frames

    What if I was trying to set a specific manual profit target/stop out on a shorter (faster) time frame, like a red bar of the 5 minute.
    Can I just throw this code into my
    Code:
    protected override void OnBarUpdate()
    ?

    Code:
    if (BarsPeriod.BarsPeriodType == BarsPeriodType.Minute && BarsPeriod.Value == 5)
       {
              // Indicator calculation logic here
    
              if (Close[0] < Low[1]) //break out to the down side
                   {
                     ExitLong(DefaultQuantity,"","");
                   }
    }
    Would I need to run unlocked code for it to even work? Thanks

    #2
    Hello ezrollin,

    The strategy would need to be unlocked to place orders to an added series as this is not possible with the Strategy Builder. With the Strategy Builder orders must be placed to the primary series (chart series).

    You could instead make the chart have the time frame you want the orders to update on, and add the other series as added series, instead of that being the primary series (chart series).

    Below is a link to the unlocked example of placing orders to the BarsInProgress of an added series.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    89 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X