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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    58 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X